diff options
author | Edward Hervey <edward@centricular.com> | 2022-07-12 10:44:51 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2022-08-04 14:49:27 +0100 |
commit | 6934362817f9db82db676580272fa84510f85494 (patch) | |
tree | 7d11593dcf68a77fbc4d0f44fd30af2163feb09c /subprojects/gst-plugins-good/ext | |
parent | 5d0b112c0c7975d6dfb907fbef4dc0f5cece97f9 (diff) |
hlsdemux2: Always check DSN if required
We don't want to consider the candidate as being before the playlist if the DSN
don't match
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2839>
Diffstat (limited to 'subprojects/gst-plugins-good/ext')
-rw-r--r-- | subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c index 72eabccc5b..da9fd6e12d 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c @@ -1045,6 +1045,11 @@ find_segment_in_playlist (GstHLSMediaPlaylist * playlist, for (idx = 0; idx < playlist->segments->len; idx++) { GstM3U8MediaSegment *cand = g_ptr_array_index (playlist->segments, idx); + /* Ignore non-matching DSN if needed */ + if ((segment->discont_sequence != cand->discont_sequence) + && playlist->has_ext_x_dsn) + continue; + if (idx == 0 && cand->sequence == segment->sequence + 1) { /* Special case for segments just before the 1st one. We add another * reference because it now also belongs to the current playlist */ @@ -1055,9 +1060,7 @@ find_segment_in_playlist (GstHLSMediaPlaylist * playlist, return segment; } - if ((segment->discont_sequence == cand->discont_sequence - || !playlist->has_ext_x_dsn) - && (cand->sequence == segment->sequence)) { + if (cand->sequence == segment->sequence) { return cand; } } |