hlsdemux: update current variant if connection speed is set

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
This commit is contained in:
Maroš Ondrášek 2015-12-02 11:01:53 +01:00 committed by Sebastian Dröge
parent 92d926d733
commit 905158a055

View 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);
}