summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-04-11 22:05:23 +0000
committerjstebbins <[email protected]>2012-04-11 22:05:23 +0000
commit4bf4a037b3603d83c47d911c394383915a2eca51 (patch)
tree79d1f5a622c9dca6ef5485924c6482ea22868e36 /libhb/stream.c
parent7c0f173350ef0ef7283e20d0567742cfbea12744 (diff)
and really merge the broken DTS timestamp fix to bugfix branch
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.9.x@4591 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/stream.c')
-rw-r--r--libhb/stream.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index a60b0d3cd..a42c15bcb 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -2923,6 +2923,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);