transcoder: Fix usage of g_error_propagate

In the error callback we were propagating an error we were not owning
which is incorrect use of the API.

Also we were clearing a GError we already propagated which is wrong
as propagating gives ownership away.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2325>
This commit is contained in:
Thibault Saunier 2021-06-14 13:16:30 -04:00 committed by GStreamer Marge Bot
parent d85368eada
commit d7c716d562

View file

@ -938,7 +938,7 @@ static void
_error_cb (RunSyncData * data, GError * error, GstStructure * details)
{
if (data->error == NULL)
g_propagate_error (&data->error, error);
data->error = g_error_copy (error);
if (data->loop) {
g_main_loop_quit (data->loop);
@ -990,7 +990,6 @@ gst_transcoder_run (GstTranscoder * self, GError ** error)
if (error)
g_propagate_error (error, data.error);
g_clear_error (&data.error);
return FALSE;
}