summaryrefslogtreecommitdiffstats
path: root/libhb/demuxmpeg.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-03-18 19:43:12 +0000
committerjstebbins <[email protected]>2012-03-18 19:43:12 +0000
commit4ff24a85e32d10ee8ab5ed524ec03e3f22da92e1 (patch)
treebfc0f4233f1547724ffb5aba599624f948fd8ac6 /libhb/demuxmpeg.c
parent5133791ebd1528a04c4bee3acd7ebd606ff1fc19 (diff)
libhb: fix problem with early termination when stream has no PCRs
A prior change I made fixed an issue with misdetection of discontinuities, but it created this early termination problem. I didn't see it because all my PCR-less samples were less than 5 minutes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4514 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/demuxmpeg.c')
-rw-r--r--libhb/demuxmpeg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libhb/demuxmpeg.c b/libhb/demuxmpeg.c
index 658bd5d39..abddecb4b 100644
--- a/libhb/demuxmpeg.c
+++ b/libhb/demuxmpeg.c
@@ -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;