hlsdemux: Stop leaking GErrors in some error paths

This commit is contained in:
Sebastian Dröge 2014-02-12 16:46:31 +01:00
parent 62ddd34807
commit adea24cdf8

View file

@ -914,17 +914,19 @@ gst_hls_demux_updates_loop (GstHLSDemux * demux)
GST_DEBUG_OBJECT (demux, "queue not full, get next fragment"); GST_DEBUG_OBJECT (demux, "queue not full, get next fragment");
if (!gst_hls_demux_get_next_fragment (demux, FALSE, &err)) { if (!gst_hls_demux_get_next_fragment (demux, FALSE, &err)) {
if (demux->cancelled) { if (demux->cancelled) {
g_clear_error (&err);
goto quit; goto quit;
} else if (!demux->end_of_playlist) { } else if (!demux->end_of_playlist) {
demux->client->update_failed_count++; demux->client->update_failed_count++;
if (demux->client->update_failed_count < DEFAULT_FAILED_COUNT) { if (demux->client->update_failed_count < DEFAULT_FAILED_COUNT) {
GST_WARNING_OBJECT (demux, "Could not fetch the next fragment"); GST_WARNING_OBJECT (demux, "Could not fetch the next fragment");
g_clear_error (&err);
continue; continue;
} else { } else {
gst_element_post_message (GST_ELEMENT_CAST (demux), gst_element_post_message (GST_ELEMENT_CAST (demux),
gst_message_new_error (GST_OBJECT_CAST (demux), err, gst_message_new_error (GST_OBJECT_CAST (demux), err,
"Could not fetch the next fragment")); "Could not fetch the next fragment"));
g_error_free (err); g_clear_error (&err);
goto error; goto error;
} }
} }
@ -1063,8 +1065,8 @@ gst_hls_demux_cache_fragments (GstHLSDemux * demux)
gst_element_post_message (GST_ELEMENT_CAST (demux), gst_element_post_message (GST_ELEMENT_CAST (demux),
gst_message_new_error (GST_OBJECT_CAST (demux), err, gst_message_new_error (GST_OBJECT_CAST (demux), err,
"Error caching the first fragments")); "Error caching the first fragments"));
g_error_free (err);
} }
g_clear_error (&err);
return FALSE; return FALSE;
} }
/* make sure we stop caching fragments if something cancelled it */ /* make sure we stop caching fragments if something cancelled it */