diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-03-27 19:22:03 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-03-29 10:33:45 +0100 |
commit | 0cecb44813fe2893c592904ff60267a6c5171a9c (patch) | |
tree | 6f77283bc3059e5975c0e7791f20949aa2923ca3 /gst | |
parent | f701755b83ce059f8a719b1584b2b4891bb30a57 (diff) |
mpegtsbase: Fix pull mode scanning for PCR on small files
If a file does not contain 5 PCRs until it is EOS, or does not
contain more than 655360 bytes the PCR scanning algorithm just
aborted.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegtsdemux/mpegtsbase.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c index 3860cad40..a5a8ee61f 100644 --- a/gst/mpegtsdemux/mpegtsbase.c +++ b/gst/mpegtsdemux/mpegtsbase.c @@ -1161,7 +1161,7 @@ mpegts_base_scan (MpegTSBase * base) gboolean done = FALSE; MpegTSPacketizerPacketReturn pret; gint64 tmpval; - guint64 upstream_size, seek_pos; + gint64 upstream_size, seek_pos; GstFormat format; guint initial_pcr_seen; @@ -1172,8 +1172,12 @@ mpegts_base_scan (MpegTSBase * base) GST_DEBUG ("Grabbing %d => %d", i * 65536, 65536); ret = gst_pad_pull_range (base->sinkpad, i * 65536, 65536, &buf); - if (G_UNLIKELY (ret != GST_FLOW_OK)) + if (G_UNLIKELY (ret == GST_FLOW_EOS)) { + done = TRUE; + break; + } else if (G_UNLIKELY (ret != GST_FLOW_OK)) { goto beach; + } /* Push to packetizer */ mpegts_packetizer_push (base->packetizer, buf); @@ -1221,8 +1225,12 @@ mpegts_base_scan (MpegTSBase * base) GST_DEBUG ("Grabbing %" G_GUINT64_FORMAT " => %d", seek_pos, 65536); ret = gst_pad_pull_range (base->sinkpad, seek_pos, 65536, &buf); - if (G_UNLIKELY (ret != GST_FLOW_OK)) + if (G_UNLIKELY (ret == GST_FLOW_EOS)) { + done = TRUE; + break; + } else if (G_UNLIKELY (ret != GST_FLOW_OK)) { goto beach; + } /* Push to packetizer */ mpegts_packetizer_push (base->packetizer, buf); |