hlsdemux2: Fix parsing of EXT-X-DISCONTINUITY-SEQUENCE:0

Since the default value of `m3u8->discont_sequence` (before parsing of the
playlist data) was 0 .. we would never properly detect the presence of that
field if it was present with a value of 0.

This would later on cause havoc in playlist synchronization where we would
assume it didn't have a discontinuity sequence specified (whereas it did, and it
was 0).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6961>
This commit is contained in:
Edward Hervey 2024-04-12 15:48:34 +02:00 committed by GStreamer Marge Bot
parent 2560ac6998
commit e9214e9afc

View file

@ -417,7 +417,7 @@ gst_hls_media_playlist_new (const gchar * uri, const gchar * base_uri)
m3u8->targetduration = GST_CLOCK_TIME_NONE;
m3u8->partial_targetduration = GST_CLOCK_TIME_NONE;
m3u8->media_sequence = 0;
m3u8->discont_sequence = 0;
m3u8->discont_sequence = -1;
m3u8->endlist = FALSE;
m3u8->i_frame = FALSE;
m3u8->allowcache = TRUE;
@ -1243,6 +1243,9 @@ gst_hls_media_playlist_parse (gchar * data,
return NULL;
}
if (!self->has_ext_x_dsn)
self->discont_sequence = 0;
/* Now go over the parsed data to ensure MSN and/or PDT are set */
if (self->ext_x_pdt_present)
gst_hls_media_playlist_postprocess_pdt (self);