From 9ce5646a0fe786d42c3cbb26e5a1dab43dec7c12 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Mon, 10 Oct 2016 16:41:15 -0600 Subject: [PATCH] hlsdemux: Add support for EXT-X-DISCONTINUITY-SEQUENCE https://bugzilla.gnome.org/show_bug.cgi?id=772811 --- ext/hls/m3u8.c | 9 ++++++++- ext/hls/m3u8.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/hls/m3u8.c b/ext/hls/m3u8.c index 316b021..6cc7a71 100644 --- a/ext/hls/m3u8.c +++ b/ext/hls/m3u8.c @@ -599,7 +599,14 @@ gst_m3u8_update (GstM3U8 * self, gchar * data) mediasequence = val; have_mediasequence = TRUE; } - } else if (g_str_has_prefix (data_ext_x, "DISCONTINUITY")) { + } else if (g_str_has_prefix (data_ext_x, "DISCONTINUITY-SEQUENCE:")) { + if (int_from_string (data + 30, &data, &val) + && val != self->discont_sequence) { + self->discont_sequence = val; + discontinuity = TRUE; + } + } else if (g_str_has_prefix (data_ext_x, "DISCONTINUITY:")) { + self->discont_sequence++; discontinuity = TRUE; } else if (g_str_has_prefix (data_ext_x, "PROGRAM-DATE-TIME:")) { /* */ diff --git a/ext/hls/m3u8.h b/ext/hls/m3u8.h index 3a5023b..195ec2a 100644 --- a/ext/hls/m3u8.h +++ b/ext/hls/m3u8.h @@ -74,6 +74,7 @@ struct _GstM3U8 GstClockTime first_file_start; /* timecode of the start of the first fragment in the current media playlist */ GstClockTime last_file_end; /* timecode of the end of the last fragment in the current media playlist */ GstClockTime duration; /* cached total duration */ + gint discont_sequence; /* currently expected EXT-X-DISCONTINUITY-SEQUENCE */ /*< private > */ gchar *last_data; -- 2.7.4