Skip to content

Commit

Permalink
Merge pull request #42 from solomax/master
Browse files Browse the repository at this point in the history
VOD is fixed, logging is improved
  • Loading branch information
mondain committed Mar 4, 2016
2 parents c544e43 + 063b652 commit 84b4a80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,15 @@ public Packet decodePacket(RTMPConnection conn, RTMPDecodeState state, IoBuffer
in.skip(length);
buf.put(chunk);
if (buf.hasRemaining()) {
//buf is incomplete
return null;
log.trace("Packet is incomplete ({},{})", buf.remaining(), buf.limit());
return null;
}
buf.flip();
try {
final IRTMPEvent message = decodeMessage(conn, packet.getHeader(), buf);
if (log.isTraceEnabled()) {
log.trace("Decoded message: {}", message);
}
// flash will send an earlier time stamp when resetting a video stream with a new key frame. To avoid dropping it,
// we give it the minimal increment since the last message. To avoid relative time stamps being mis-computed, we
// don't reset the header we stored.
Expand Down Expand Up @@ -297,6 +300,8 @@ public Packet decodePacket(RTMPConnection conn, RTMPDecodeState state, IoBuffer
/**
* Decodes packet header.
*
* @param chh
* chunk header
* @param state
* RTMP decode state
* @param in
Expand Down
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 @@ -1039,7 +1039,7 @@ private void sendMessage(RTMPMessage messageIn) {
log.trace("clientBufferDetails: timestamp {} delta {} buffered {}", new Object[] { lastMessageTs, delta, lastMessageTs - delta });
}
// don't reset streamStartTS to 0 for live streams
if ((ts > 0 || playDecision != 0) || streamStartTS.get() > ts) {
if ((streamStartTS.get() == -1 && (ts > 0 || playDecision != 0)) || streamStartTS.get() > ts) {
log.debug("sendMessage: resetting streamStartTS");
streamStartTS.compareAndSet(-1, ts);
messageOut.getBody().setTimestamp(0);
Expand Down

0 comments on commit 84b4a80

Please sign in to comment.