From 74f25cca31948aaff9b30bada6d810cae8da84a3 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 27 May 2022 11:20:06 +0200 Subject: [PATCH] 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: --- .../gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c index 4e4a8c757b..0f92170c3a 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/gsthlsdemux-util.c @@ -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;