From a072101441a648ccd315a3ed8212071404bacc55 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 22 Dec 2015 10:15:39 -0300 Subject: [PATCH] hlsdemux: make sure every bad update_playlist return sets an error Otherwise it segfaults when reporting the error in the bus --- ext/hls/gsthlsdemux.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c index 8611e76056..6c5468dee6 100644 --- a/ext/hls/gsthlsdemux.c +++ b/ext/hls/gsthlsdemux.c @@ -829,20 +829,20 @@ retry: if (download == NULL) { gchar *base_uri; - g_clear_error (err); if (!update || main_checked || !gst_m3u8_client_has_variant_playlist (demux->client)) { g_free (uri); return FALSE; } + g_clear_error (err); main_uri = gst_m3u8_client_get_uri (demux->client); GST_INFO_OBJECT (demux, "Updating playlist %s failed, attempt to refresh variant playlist %s", uri, main_uri); download = gst_uri_downloader_fetch_uri (adaptive_demux->downloader, - main_uri, NULL, TRUE, TRUE, TRUE, NULL); + main_uri, NULL, TRUE, TRUE, TRUE, err); g_free (main_uri); if (download == NULL) { g_free (uri); @@ -858,6 +858,8 @@ retry: "Failed to validate variant playlist encoding"); g_free (uri); g_object_unref (download); + g_set_error (err, GST_STREAM_ERROR, GST_STREAM_ERROR_WRONG_TYPE, + "Couldn't validate playlist encoding"); return FALSE; } @@ -874,6 +876,8 @@ retry: uri, base_uri)) { GST_WARNING_OBJECT (demux, "Failed to update the variant playlist"); g_object_unref (download); + g_set_error (err, GST_STREAM_ERROR, GST_STREAM_ERROR_FAILED, + "Couldn't update playlist"); return FALSE; }