hlsdemux: reflow update_playlist a bit

Reduce indentation by erroring out directly on failure.
This commit is contained in:
Tim-Philipp Müller 2015-12-19 21:10:56 +00:00
parent 8be5551dff
commit d5e115171b

View file

@ -827,9 +827,15 @@ retry:
TRUE, TRUE, TRUE, err); TRUE, TRUE, TRUE, err);
g_free (main_uri); g_free (main_uri);
if (download == NULL) { if (download == NULL) {
gchar *base_uri;
g_clear_error (err); g_clear_error (err);
if (update && !main_checked if (!update || main_checked
&& gst_m3u8_client_has_variant_playlist (demux->client)) { || !gst_m3u8_client_has_variant_playlist (demux->client)) {
g_free (uri);
return FALSE;
}
main_uri = gst_m3u8_client_get_uri (demux->client); main_uri = gst_m3u8_client_get_uri (demux->client);
GST_INFO_OBJECT (demux, GST_INFO_OBJECT (demux,
"Updating playlist %s failed, attempt to refresh variant playlist %s", "Updating playlist %s failed, attempt to refresh variant playlist %s",
@ -838,8 +844,10 @@ retry:
gst_uri_downloader_fetch_uri (adaptive_demux->downloader, gst_uri_downloader_fetch_uri (adaptive_demux->downloader,
main_uri, NULL, TRUE, TRUE, TRUE, NULL); main_uri, NULL, TRUE, TRUE, TRUE, NULL);
g_free (main_uri); g_free (main_uri);
if (download != NULL) { if (download == NULL) {
gchar *base_uri; g_free (uri);
return FALSE;
}
buf = gst_fragment_get_buffer (download); buf = gst_fragment_get_buffer (download);
playlist = gst_hls_src_buf_to_utf8_playlist (buf); playlist = gst_hls_src_buf_to_utf8_playlist (buf);
@ -873,14 +881,6 @@ retry:
main_checked = TRUE; main_checked = TRUE;
goto retry; goto retry;
} else {
g_free (uri);
return FALSE;
}
} else {
g_free (uri);
return FALSE;
}
} }
g_free (uri); g_free (uri);