mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
convertframe: Error out directly if changing the pipeline state to PLAYING failed
This commit is contained in:
parent
98109bd5de
commit
d9cf2973da
1 changed files with 17 additions and 1 deletions
|
@ -766,7 +766,9 @@ gst_video_convert_sample_async (GstSample * sample,
|
|||
g_source_unref (source);
|
||||
gst_object_unref (bus);
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||
if (gst_element_set_state (pipeline,
|
||||
GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE)
|
||||
goto state_change_failed;
|
||||
|
||||
gst_caps_unref (to_caps_copy);
|
||||
|
||||
|
@ -783,6 +785,20 @@ no_pipeline:
|
|||
g_mutex_unlock (&ctx->mutex);
|
||||
gst_video_convert_frame_context_unref (ctx);
|
||||
|
||||
return;
|
||||
}
|
||||
state_change_failed:
|
||||
{
|
||||
gst_caps_unref (to_caps_copy);
|
||||
|
||||
error = g_error_new (GST_CORE_ERROR, GST_CORE_ERROR_STATE_CHANGE,
|
||||
"failed to change state to PLAYING");
|
||||
|
||||
g_mutex_lock (&ctx->mutex);
|
||||
convert_frame_finish (ctx, NULL, error);
|
||||
g_mutex_unlock (&ctx->mutex);
|
||||
gst_video_convert_frame_context_unref (ctx);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue