diff options
-rw-r--r-- | libhb/stream.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/stream.c b/libhb/stream.c index 3f5680ef2..2c7c4f9a5 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -2922,6 +2922,13 @@ static int parse_pes_header( pes_info->dts = pes_info->pts; } } + // A user encountered a stream that has garbage DTS timestamps. + // DTS should never be > PTS. Such broken timestamps leads to + // HandBrake computing negative buffer start times. + if (pes_info->dts > pes_info->pts) + { + pes_info->dts = pes_info->pts; + } if ( has_escr ) bits_skip(&bb_hdr, 8 * 6); |