Commit 259d30c4 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵 Committed by Tim-Philipp Müller

convertframe: Error out directly if changing the pipeline state to PLAYING failed

parent dc6566dc
......@@ -763,7 +763,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);
......@@ -780,6 +782,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;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment