hlsdemux2: Look for mpegts synchronization point further

Some mpeg-ts streams have extra data at the beginning. While it's not ideal, we
should be able to cope with it.

Therefore increase the initial search window for at least 4 consecutive
synchronization points to 1kB.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2626>
This commit is contained in:
Edward Hervey 2022-05-27 11:20:06 +02:00 committed by GStreamer Marge Bot
parent c4971a456e
commit 74f25cca31

View file

@ -173,7 +173,7 @@ find_offset (const guint8 * data, guint size, guint * out_packet_size)
const gint packet_size = 188;
/* FIXME: check 192 as well, and maybe also 204, 208 */
for (off = 0; off < MIN (size, packet_size); ++off) {
for (off = 0; off < MIN (size, 1024); ++off) {
if (have_ts_sync (data + off, size - off, packet_size, sync_points)) {
*out_packet_size = packet_size;
return off;