diff options
author | John Stebbins <[email protected]> | 2016-11-21 10:31:17 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-11-21 10:32:45 -0800 |
commit | 0f7a1b95960fbbf82d77702da7e299c4980ed8c4 (patch) | |
tree | a3d1cb9697253b16e51ee2a2ba0d17b6fd0f7a22 /libhb | |
parent | 66f68fa5b4f1c0312182fa3937fe8d7e163096d0 (diff) |
stream: be more forgiving of TS continuity errors
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/stream.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libhb/stream.c b/libhb/stream.c index 2cdd4503d..c6242f829 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -4795,11 +4795,15 @@ hb_buffer_t * hb_ts_decode_pkt( hb_stream_t *stream, const uint8_t * pkt, !ts_stream->skipbad && (continuity != ( (ts_stream->continuity + 1) & 0xf ) ) ) { - ts_err( stream, curstream, "continuity error: got %d expected %d", - (int)continuity, - (ts_stream->continuity + 1) & 0xf ); + if (continuity == ts_stream->continuity) + { + // Duplicate packet as defined by ITU-T Rec. H.222 + // Drop the packet. + return hb_buffer_list_clear(&list); + } + ts_warn( stream, "continuity error: got %d expected %d", + (int)continuity, (ts_stream->continuity + 1) & 0xf ); ts_stream->continuity = continuity; - return hb_buffer_list_clear(&list); } ts_stream->continuity = continuity; |