Skip to content

Commit

Permalink
Updating for next snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mondain committed Feb 7, 2017
1 parent 75c9933 commit 8b56c3d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/red5/server/stream/PlayEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ public void pushMessage(IPipe pipe, IMessage message) throws IOException {
rtmpMessage = RTMPMessage.build(interframe);
} else {
// it means that new keyframe was received and we should send current frames instead of buffered
bufferedInterframeIdx = 0;
bufferedInterframeIdx = -1;
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/red5/server/stream/StreamService.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ public void play2(Map<String, ?> playOptions) {

/** {@inheritDoc} */
public void publish(Boolean dontStop) {
if (!dontStop) {
// null is as good as false according to Boolean.valueOf() so if null, interpret as false
if (dontStop == null || !dontStop) {
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,18 @@ private IStreamCapableConnection getStats() {

public Map<String, Object> checkBandwidth(Object[] params) {
final IStreamCapableConnection stats = getStats();
Map<String, Object> statsValues = new HashMap<String, Object>();
Integer time = (Integer) (params.length > 0 ? params[0] : 0);
Map<String, Object> statsValues = new HashMap<>();
Number time = 0;
if (params.length > 0) {
if (params[0] instanceof Double) {
time = (Double) params[0];
} else {
time = (Integer) params[0];
}
}
statsValues.put("cOutBytes", stats.getReadBytes());
statsValues.put("cInBytes", stats.getWrittenBytes());
statsValues.put("time", time);
statsValues.put("time", time.intValue());
log.debug("cOutBytes: {} cInBytes: {} time: {}", new Object[] { stats.getReadBytes(), stats.getWrittenBytes(), time });
return statsValues;
}
Expand Down

0 comments on commit 8b56c3d

Please sign in to comment.