]> granicus.if.org Git - handbrake/commitdiff
libhb: merge fix for early termination of PCR-less streams to bug fix branch
authorjstebbins <jstebbins.hb@gmail.com>
Sun, 18 Mar 2012 20:03:10 +0000 (20:03 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Sun, 18 Mar 2012 20:03:10 +0000 (20:03 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.9.x@4516 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/demuxmpeg.c

index 658bd5d39010010a4a7b5f88abbf6139661dea5b..abddecb4b7af5481c8dc984df1751360fdc0707c 100644 (file)
@@ -290,6 +290,15 @@ void hb_demux_mpeg( hb_buffer_t *buf, hb_list_t *list_es, hb_psdemux_t *state )
                     buf = tmp;
                     continue;
                 }
+                else
+                {
+                    // Some streams have no PCRs.  In these cases, we
+                    // will only get an "PCR" update if a large change
+                    // in DTS or PTS is detected.  So we need to update
+                    // our scr_delta with each valid timestamp so that
+                    // fdelta does not continually grow.
+                    state->scr_delta = buf->start - state->last_scr;
+                }
                 if ( state->last_pts >= 0 )
                 {
                     fdelta = buf->start - state->last_pts;