mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
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.
This commit is contained in:
parent
f701755b83
commit
0cecb44813
1 changed files with 11 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue