From 9e5621c12a6c21c24a5b1e7829a9f37a50aca389 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Sun, 27 Oct 2013 22:09:29 -0700 Subject: [PATCH] Sync new GStreamer element to parent state In GStreamer 1.0, when adding a new element to the pipeline in a signal handler, its state has to be synced to the pipeline's state, because the handler could be called in the middle of a state change which would cause the state change to hang. This was supposed to be done in GStreamer 0.10 too, but it never caused any problems. --- libchimara/schannel.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libchimara/schannel.c b/libchimara/schannel.c index 3c75599..f6bd1ff 100644 --- a/libchimara/schannel.c +++ b/libchimara/schannel.c @@ -170,6 +170,12 @@ on_type_found(GstElement *typefind, guint probability, GstCaps *caps, schanid_t WARNING_S(_("Unexpected audio type in blorb"), type); } + /* This is necessary in case this handler occurs in the middle of a state + change */ + gst_element_sync_state_with_parent(s->decode); + if(s->demux != NULL) + gst_element_sync_state_with_parent(s->demux); + finally: g_free(type); } -- 2.30.2