hlsdemux: after update playlist, setup streams if current variant changes 37/273437/3 accepted/tizen/6.5/unified/20220406.134317 submit/tizen_6.5/20220406.053421
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 5 Apr 2022 07:03:05 +0000 (16:03 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 6 Apr 2022 02:24:03 +0000 (11:24 +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.

Change-Id: I567f3880d047e959d21bfccfea4e1ca4cd9deb71

ext/hls/gsthlsdemux.c
packaging/gst-plugins-bad.spec

index e41d3fdbe9f65f285bf31631e28326e631001160..629975bce241a6f6347c4594eddb2599eaba89a6 100644 (file)
@@ -147,6 +147,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);
@@ -582,9 +585,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 ee9d137bc163ba527ac6671ab68dd3efdcf96397..7c98ea4387c153d2d1aa29dba1140dcb37206d3c 100644 (file)
@@ -4,7 +4,7 @@
 
 Name:           gst-plugins-bad
 Version:        1.16.2
-Release:        29
+Release:        30
 Summary:        GStreamer Streaming-Media Framework Plug-Ins
 License:        LGPL-2.0+
 Group:          Multimedia/Framework
@@ -84,6 +84,7 @@ export CFLAGS+=" -Wall -g -fPIC\
   -DTIZEN_FEATURE_HLSDEMUX_EMPTY_VTT\
   -DTIZEN_FEATURE_HLSDEMUX_UPDATE_SEGMENT\
   -DTIZEN_FEATURE_HLSDEMUX_DISCONT_SEQUENCE\
+  -DTIZEN_FEATURE_HLSDEMUX_UPDATE_MANIFEST\
   -DTIZEN_FEATURE_TSDEMUX_MODIFICATION\
   -DTIZEN_FEATURE_TSDEMUX_INVALID_PCR_PID\
   -DTIZEN_FEATURE_TSDEMUX_LANG_TAG\