From 4a9a9ed9fca7a544cab34658d6b675ced1a13c42 Mon Sep 17 00:00:00 2001 From: Florian Zwoch Date: Tue, 26 Sep 2023 16:48:10 +0000 Subject: [PATCH] adaptivedemux2: Call GTasks's return functions for blocking tasks Gio/Task states the following: If a GTask has been constructed and its callback set, it is an error to not call g_task_return_*() on it. GLib will warn at runtime if this happens (since 2.76). Part-of: --- .../gst-plugins-good/ext/adaptivedemux2/downloadhelper.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c index 962de66c30..6fd59e3dae 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/downloadhelper.c @@ -99,7 +99,7 @@ transfer_completion_cb (gpointer src_object, GAsyncResult * res, DownloadRequest *request = transfer->request; if (transfer->blocking) - return; /* Somehow a completion got signalled for a blocking request */ + return; download_request_lock (request); request->in_use = FALSE; @@ -201,7 +201,8 @@ finish_transfer_task (DownloadHelper * dh, GTask * transfer_task, if (transfer->blocking) g_cond_broadcast (&transfer->cond); - else if (error != NULL) + + if (error != NULL) g_task_return_error (transfer_task, error); else g_task_return_boolean (transfer_task, TRUE); @@ -809,8 +810,8 @@ downloadhelper_stop (DownloadHelper * dh) transfer->complete = TRUE; if (transfer->blocking) g_cond_broadcast (&transfer->cond); - else - g_task_return_boolean (transfer_task, TRUE); + + g_task_return_boolean (transfer_task, TRUE); } g_array_set_size (dh->active_transfers, 0);