mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
hlsdemux: Simplify logic in process_manifest
Simplify logic in process_manifest and remove a TODO item. https://bugzilla.gnome.org/show_bug.cgi?id=749328
This commit is contained in:
parent
6b43d7f770
commit
4ca3a22b6b
2 changed files with 10 additions and 11 deletions
|
@ -438,18 +438,12 @@ gst_hls_demux_process_manifest (GstAdaptiveDemux * demux, GstBuffer * buf)
|
||||||
if (gst_m3u8_client_has_variant_playlist (hlsdemux->client)) {
|
if (gst_m3u8_client_has_variant_playlist (hlsdemux->client)) {
|
||||||
GstM3U8 *child = NULL;
|
GstM3U8 *child = NULL;
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
|
GList *current_variant = NULL;
|
||||||
|
|
||||||
/* TODO seems like something that could be simplified */
|
current_variant =
|
||||||
if (demux->connection_speed == 0) {
|
gst_m3u8_client_get_playlist_for_bitrate (hlsdemux->client,
|
||||||
GST_M3U8_CLIENT_LOCK (hlsdemux->client);
|
demux->connection_speed);
|
||||||
child = hlsdemux->client->main->current_variant->data;
|
child = GST_M3U8 (current_variant->data);
|
||||||
GST_M3U8_CLIENT_UNLOCK (hlsdemux->client);
|
|
||||||
} else {
|
|
||||||
GList *tmp = gst_m3u8_client_get_playlist_for_bitrate (hlsdemux->client,
|
|
||||||
demux->connection_speed);
|
|
||||||
|
|
||||||
child = GST_M3U8 (tmp->data);
|
|
||||||
}
|
|
||||||
|
|
||||||
gst_m3u8_client_set_current (hlsdemux->client, child);
|
gst_m3u8_client_set_current (hlsdemux->client, child);
|
||||||
if (!gst_hls_demux_update_playlist (hlsdemux, FALSE, &err)) {
|
if (!gst_hls_demux_update_playlist (hlsdemux, FALSE, &err)) {
|
||||||
|
|
|
@ -1257,6 +1257,11 @@ gst_m3u8_client_get_playlist_for_bitrate (GstM3U8Client * client, guint bitrate)
|
||||||
GST_M3U8_CLIENT_LOCK (client);
|
GST_M3U8_CLIENT_LOCK (client);
|
||||||
current_variant = client->main->current_variant;
|
current_variant = client->main->current_variant;
|
||||||
|
|
||||||
|
if (bitrate == 0) {
|
||||||
|
GST_M3U8_CLIENT_UNLOCK (client);
|
||||||
|
return current_variant;
|
||||||
|
}
|
||||||
|
|
||||||
/* Go to the highest possible bandwidth allowed */
|
/* Go to the highest possible bandwidth allowed */
|
||||||
while (GST_M3U8 (current_variant->data)->bandwidth <= bitrate) {
|
while (GST_M3U8 (current_variant->data)->bandwidth <= bitrate) {
|
||||||
list = g_list_next (current_variant);
|
list = g_list_next (current_variant);
|
||||||
|
|
Loading…
Reference in a new issue