]> granicus.if.org Git - handbrake/commitdiff
and really merge the broken DTS timestamp fix to bugfix branch
authorjstebbins <jstebbins.hb@gmail.com>
Wed, 11 Apr 2012 22:05:23 +0000 (22:05 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Wed, 11 Apr 2012 22:05:23 +0000 (22:05 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.9.x@4591 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/stream.c

index a60b0d3cdbad318523fb66fd4a80f9aa15e999b3..a42c15bcb1f6d117c39386c3074fa4a24099c2fb 100644 (file)
@@ -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);