From 5c8ebb4adac3ba927345d4bf78d80d4a61278f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 21 Oct 2015 18:31:43 +0300 Subject: [PATCH] mxfdemux-structure: Sync fakesink state with the bin to make the application work at all --- tests/examples/mxf/mxfdemux-structure.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/examples/mxf/mxfdemux-structure.c b/tests/examples/mxf/mxfdemux-structure.c index 1a802a7c36..a24a310824 100644 --- a/tests/examples/mxf/mxfdemux-structure.c +++ b/tests/examples/mxf/mxfdemux-structure.c @@ -182,6 +182,7 @@ on_pad_added (GstElement * src, GstPad * pad, gpointer data) GstElement *bin = (GstElement *) gst_element_get_parent (src); gst_bin_add (GST_BIN (bin), fakesink); + gst_element_sync_state_with_parent (fakesink); gst_pad_link (pad, sinkpad); @@ -244,7 +245,10 @@ main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (window), scrolled_window); gtk_widget_show_all (window); - gst_element_set_state (pipeline, GST_STATE_PLAYING); + if (gst_element_set_state (pipeline, + GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { + g_error ("Failed to change state to PLAYING"); + } gtk_main ();