hlsdemux: after update playlist, setup streams if current variant changes 38/273438/3 submit/tizen/20220406.053411
authorGilbok Lee <gilbok.lee@samsung.com>
Wed, 6 Apr 2022 00:15:03 +0000 (09:15 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 6 Apr 2022 05:13:14 +0000 (14:13 +0900)
- If the playlist update fails, the main playlist is downloaded newly
  At this time, a new playlist is created and the previous playlist isn't updated.

[Version] 1.20.0-12
[Issue Type] Bug fix

Change-Id: If7313c529b411d9f6c86019e3e24c6f4f475dda7

packaging/gstreamer.spec
subprojects/gst-plugins-bad/ext/hls/gsthlsdemux.c
subprojects/gst-plugins-bad/meson.build

index 8133dd2..468dfe0 100644 (file)
@@ -59,7 +59,7 @@
 
 Name:           %{_name}
 Version:        1.20.0
-Release:        11
+Release:        12
 Summary:        Streaming-Media Framework Runtime
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
index ce87f14..4c3dbde 100644 (file)
@@ -150,6 +150,9 @@ static gboolean gst_hlsdemux_set_stream_event (GstAdaptiveDemuxStream * stream,
 static gboolean gst_hlsdemux_set_language_tags (GstAdaptiveDemuxStream * stream,
     const gchar * language);
 #endif
+#ifdef TIZEN_FEATURE_HLSDEMUX_UPDATE_MANIFEST
+static gboolean gst_hls_demux_setup_streams (GstAdaptiveDemux * demux);
+#endif
 
 #define gst_hls_demux_parent_class parent_class
 G_DEFINE_TYPE (GstHLSDemux, gst_hls_demux, GST_TYPE_ADAPTIVE_DEMUX);
@@ -578,9 +581,19 @@ static GstFlowReturn
 gst_hls_demux_update_manifest (GstAdaptiveDemux * demux)
 {
   GstHLSDemux *hlsdemux = GST_HLS_DEMUX_CAST (demux);
+#ifdef TIZEN_FEATURE_HLSDEMUX_UPDATE_MANIFEST
+  GstHLSVariantStream *prev_variant = hlsdemux->current_variant;
+#endif
+
   if (!gst_hls_demux_update_playlist (hlsdemux, TRUE, NULL))
     return GST_FLOW_ERROR;
 
+#ifdef TIZEN_FEATURE_HLSDEMUX_UPDATE_MANIFEST
+  if (hlsdemux->current_variant != prev_variant
+      && !gst_hls_demux_setup_streams (demux))
+    return GST_FLOW_ERROR;
+#endif
+
   return GST_FLOW_OK;
 }
 
index 1fb32df..d9697df 100644 (file)
@@ -440,6 +440,7 @@ cdata.set('TIZEN_FEATURE_HLSDEMUX_PROPERTY', true)
 cdata.set('TIZEN_FEATURE_HLSDEMUX_EMPTY_VTT', true)
 cdata.set('TIZEN_FEATURE_HLSDEMUX_UPDATE_SEGMENT', true)
 cdata.set('TIZEN_FEATURE_HLSDEMUX_DISCONT_SEQUENCE', true)
+cdata.set('TIZEN_FEATURE_HLSDEMUX_UPDATE_MANIFEST', true)
 cdata.set('TIZEN_FEATURE_TSDEMUX_MODIFICATION', true)
 cdata.set('TIZEN_FEATURE_TSDEMUX_INVALID_PCR_PID', true)
 cdata.set('TIZEN_FEATURE_TSDEMUX_LANG_TAG', true)