diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2018-11-23 13:21:23 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-01 17:00:38 +0100 |
commit | 259d30c4802202c95ab78c2ef97b1288005c77f5 (patch) | |
tree | f073a5be6d1fab59214c0eb9dbe9e0a393539b66 | |
parent | dc6566dc2debf05f5cca7b94dc57bc259c87cdd7 (diff) | |
download | gstreamer-plugins-base-259d30c4802202c95ab78c2ef97b1288005c77f5.tar.gz |
convertframe: Error out directly if changing the pipeline state to PLAYING failed
-rw-r--r-- | gst-libs/gst/video/convertframe.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gst-libs/gst/video/convertframe.c b/gst-libs/gst/video/convertframe.c index ce6845117..b3aab9a42 100644 --- a/gst-libs/gst/video/convertframe.c +++ b/gst-libs/gst/video/convertframe.c @@ -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); @@ -782,4 +784,18 @@ no_pipeline: 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; + } } |