mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
mpegtsdemux: fix re-syncing on invalid data after seek
Or possibly even at startup. If we couldn't find a sync within the first few bytes, we'd just push more data into the adapter but never discard any of the invalid data at the beginning, so would never be able to re-sync. https://bugzilla.gnome.org/show_bug.cgi?id=639063
This commit is contained in:
parent
b9af27719d
commit
0b4dfa685d
1 changed files with 6 additions and 2 deletions
|
@ -2107,9 +2107,13 @@ mpegts_try_discover_packet_size (MpegTSPacketizer * packetizer)
|
|||
}
|
||||
GST_DEBUG ("have packetsize detected: %d of %u bytes",
|
||||
packetizer->know_packet_size, packetizer->packet_size);
|
||||
/* flush to sync byte */
|
||||
if (pos > 0)
|
||||
if (pos > 0) {
|
||||
/* flush to sync byte */
|
||||
gst_adapter_flush (packetizer->adapter, pos);
|
||||
} else if (!packetizer->know_packet_size) {
|
||||
/* drop invalid data and move to the next possible packets */
|
||||
gst_adapter_flush (packetizer->adapter, MPEGTS_MAX_PACKETSIZE);
|
||||
}
|
||||
g_free (dest);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue