From: Philip Chimento Date: Mon, 28 Oct 2013 05:09:29 +0000 (-0700) Subject: Sync new GStreamer element to parent state X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=9e5621c12a6c21c24a5b1e7829a9f37a50aca389;p=projects%2Fchimara%2Fchimara.git 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. --- 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); }