hlsdemux: Fix crash when NETTLE is not used
authorGilbok Lee <gilbok.lee@samsung.com>
Mon, 4 Sep 2017 08:31:05 +0000 (17:31 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Mon, 4 Sep 2017 08:58:06 +0000 (17:58 +0900)
hlsdemux: Fix bug for getting variant stream info

Change-Id: Ibe39e0749723d5ef41b927beb6066f91336e35b0

ext/hls/gsthlsdemux.c
ext/hls/m3u8.c

index d088873..c1be60d 100644 (file)
@@ -311,7 +311,6 @@ gst_hls_demux_get_bitrate (GstHLSDemux * hlsdemux)
 static void
 gst_hls_demux_clear_pending_data (GstHLSDemux * hlsdemux)
 {
-  gst_hls_demux_decrypt_end (hlsdemux);
   gst_adapter_clear (hlsdemux->pending_encrypted_data);
   gst_buffer_replace (&hlsdemux->pending_decrypted_buffer, NULL);
   gst_buffer_replace (&hlsdemux->pending_typefind_buffer, NULL);
@@ -343,9 +342,8 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
   if (flags & GST_SEEK_FLAG_FLUSH) {
 #ifdef TIZEN_FEATURE_ADAPTIVE_MODIFICATION
     gst_hls_demux_clear_pending_data (hlsdemux);
-#else
-    gst_hls_demux_decrypt_end (hlsdemux);
 #endif
+    gst_hls_demux_decrypt_end (hlsdemux);
   }
 
   /* Use I-frame variants for trick modes */
@@ -440,6 +438,8 @@ gst_hls_demux_setup_streams (GstAdaptiveDemux * demux)
   /* only 1 output supported */
 #ifdef TIZEN_FEATURE_ADAPTIVE_MODIFICATION
   gst_hls_demux_clear_pending_data (hlsdemux);
+  gst_hls_demux_decrypt_end (hlsdemux);
+
 #endif
   gst_adaptive_demux_stream_new (demux, gst_hls_demux_create_pad (hlsdemux));
 
@@ -965,7 +965,6 @@ gst_hls_demux_reset (GstAdaptiveDemux * ademux)
     g_free (demux->current_iv);
     demux->current_iv = NULL;
   }
-
   gst_hls_demux_decrypt_end (demux);
 }
 
index 1f2c724..1cfb23f 100644 (file)
@@ -790,7 +790,7 @@ gst_m3u8_update (GstM3U8Client * client, GstM3U8 * self, gchar * data,
 
 #ifdef TIZEN_FEATURE_ADAPTIVE_MODIFICATION
     /* update variant stream info */
-    for (l = self->current_variant; l != NULL; l = l->next) {
+    for (l = self->lists; l != NULL; l = l->next) {
       GstM3U8 *data = l->data;
       GstM3U8VideoVariantInfo *var_info = g_new0(GstM3U8VideoVariantInfo, 1);