summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-04-11 16:34:21 +0000
committerjstebbins <[email protected]>2012-04-11 16:34:21 +0000
commit6b442b148bf618c16793fb7787314979ee90adf8 (patch)
treefa81d55d7c5ad6977f755484fda8f1d4cce4aaab
parentd0e3d7de3966ccbccd5bc90e95ac9e7e883602df (diff)
libhb: handle TS streams that have broken DTS timestamps
If the DTS is > PTS, ignore it because this can't happen in a properly constructed TS stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4586 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/stream.c7
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);