diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c index e8a517d412..87034de0d7 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.c @@ -164,6 +164,25 @@ gst_m3u8_preload_hint_unref (GstM3U8PreloadHint * hint) } } +gboolean +gst_m3u8_preload_hint_equal (GstM3U8PreloadHint * hint1, + GstM3U8PreloadHint * hint2) +{ + if (hint1->hint_type != hint2->hint_type) + return FALSE; + + if (!g_str_equal (hint1->uri, hint2->uri)) + return FALSE; + + if (hint1->offset != hint2->offset) + return FALSE; + + if (hint1->size != hint2->size) + return FALSE; + + return TRUE; +} + static GstM3U8InitFile * gst_m3u8_init_file_new (gchar * uri, gint64 size, gint64 offset) { diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.h b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.h index 78f29d43c8..ad2ea78e1f 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.h +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/hls/m3u8.h @@ -184,11 +184,16 @@ gst_m3u8_partial_segment_ref (GstM3U8PartialSegment *part); void gst_m3u8_partial_segment_unref (GstM3U8PartialSegment *part); +/* Set up as flags, so we can form a bitmask + * of seen hint types */ enum _GstM3U8PreloadHintType { - M3U8_PRELOAD_HINT_MAP, - M3U8_PRELOAD_HINT_PART, + M3U8_PRELOAD_HINT_NONE = (0 << 0), + M3U8_PRELOAD_HINT_MAP = (1 << 0), + M3U8_PRELOAD_HINT_PART = (1 << 1), }; +#define M3U8_PRELOAD_HINT_ALL (M3U8_PRELOAD_HINT_PART | M3U8_PRELOAD_HINT_MAP) + /** * GstM3U8PreloadHint: * @@ -211,6 +216,9 @@ gst_m3u8_preload_hint_ref (GstM3U8PreloadHint *hint); void gst_m3u8_preload_hint_unref (GstM3U8PreloadHint *hint); +gboolean +gst_m3u8_preload_hint_equal (GstM3U8PreloadHint *hint1, GstM3U8PreloadHint *hint2); + /** * GstM3U8MediaSegment: *