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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5414>
This commit is contained in:
Florian Zwoch 2023-09-26 16:48:10 +00:00 committed by Tim-Philipp Müller
parent c53376cbfc
commit 80d62798c3

View file

@ -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);
@ -806,8 +807,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);