hlsdemux: update current variant if connection speed is set
authorMaroš Ondrášek <mx3ldev@gmail.com>
Wed, 2 Dec 2015 10:01:53 +0000 (11:01 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 2 Dec 2015 12:39:12 +0000 (14:39 +0200)
If connection speed is set, playlist according
to connection speed is selected as current playlist.

Problem is that the current variant of main playlist still
points to previously set variant.
If previously set variant doesn't correspond to current
playlist, then it causes unnecessary change of playlist
to the same playlist after first fragment is downloaded,
because of not updated current variant.

To fix this, we need to make sure that current variant
of main playlist corresponds to the current playlist

https://bugzilla.gnome.org/show_bug.cgi?id=758946

ext/hls/gsthlsdemux.c

index e269f7abc8d6caea7a2a27fb42fbd0fc22d33909..4ad87e87631d2106dc523e2f31f967c2f4c268c4 100644 (file)
@@ -396,6 +396,9 @@ gst_hls_demux_process_manifest (GstAdaptiveDemux * demux, GstBuffer * buf)
     } else {
       GList *tmp = gst_m3u8_client_get_playlist_for_bitrate (hlsdemux->client,
           demux->connection_speed);
+      GST_M3U8_CLIENT_LOCK (hlsdemux->client);
+      hlsdemux->client->main->current_variant = tmp;
+      GST_M3U8_CLIENT_UNLOCK (hlsdemux->client);
 
       child = GST_M3U8 (tmp->data);
     }