mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
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:
parent
c53376cbfc
commit
80d62798c3
1 changed files with 5 additions and 4 deletions
|
@ -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,7 +807,7 @@ downloadhelper_stop (DownloadHelper * dh)
|
|||
transfer->complete = TRUE;
|
||||
if (transfer->blocking)
|
||||
g_cond_broadcast (&transfer->cond);
|
||||
else
|
||||
|
||||
g_task_return_boolean (transfer_task, TRUE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue