From ec1d03e1b4e7ee103c9577adda3d8f87d0935039 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Wed, 16 Feb 2011 00:55:30 +0100 Subject: [PATCH] hlsdemux: clean up code a little bit --- gst/hls/gsthlsdemux.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/gst/hls/gsthlsdemux.c b/gst/hls/gsthlsdemux.c index 3e48add088..d31bf197af 100644 --- a/gst/hls/gsthlsdemux.c +++ b/gst/hls/gsthlsdemux.c @@ -474,11 +474,9 @@ gst_hls_demux_loop (GstHLSDemux * demux) * when we reached the end of the playlist */ if (G_UNLIKELY (demux->need_cache)) { - gboolean ret; - ret = gst_hls_demux_cache_fragments (demux); - if (!ret) { + if (!gst_hls_demux_cache_fragments (demux)) goto cache_error; - } + /* we can start now the updates thread */ gst_hls_demux_start_update (demux); GST_INFO_OBJECT (demux, "First fragments cached successfully"); @@ -739,6 +737,7 @@ static gboolean gst_hls_demux_fetch_location (GstHLSDemux * demux, const gchar * uri) { GstStateChangeReturn ret; + gboolean bret = FALSE; g_mutex_lock (demux->fetcher_lock); @@ -754,19 +753,12 @@ gst_hls_demux_fetch_location (GstHLSDemux * demux, const gchar * uri) GST_DEBUG_OBJECT (demux, "Waiting to fetch the URI"); g_cond_wait (demux->fetcher_cond, demux->fetcher_lock); - if (demux->stopping_fetcher) { - ret = FALSE; - goto quit; - } - gst_hls_demux_stop_fetcher (demux, FALSE); if (demux->downloaded_uri != NULL) { GST_INFO_OBJECT (demux, "URI fetched successfully"); - ret = TRUE; - goto quit; + bret = TRUE; } - ret = FALSE; goto quit; uri_error: @@ -774,7 +766,7 @@ uri_error: GST_ELEMENT_ERROR (demux, RESOURCE, OPEN_READ, ("Could not create an element to fetch the given URI."), ("URI: \"%s\"", uri)); - ret = FALSE; + bret = FALSE; goto quit; } @@ -782,14 +774,14 @@ state_change_error: { GST_ELEMENT_ERROR (demux, CORE, STATE_CHANGE, ("Error changing state of the fetcher element."), NULL); - ret = FALSE; + bret = FALSE; goto quit; } quit: { g_mutex_unlock (demux->fetcher_lock); - return ret; + return bret; } }