From 1c424d9d931a72b3d4a46be9a1e5ed27303f7b7d Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Thu, 22 May 2008 11:59:33 +0000 Subject: [PATCH] gst/playback/gstdecodebin.c: Lock the fakesink before setting the state to NULL and removing it from the bin so that ... Original commit message from CVS: Patch by: Sjoerd Simons * gst/playback/gstdecodebin.c: (remove_fakesink): Lock the fakesink before setting the state to NULL and removing it from the bin so that a concurrent state change cannot interfere. Fixes #534331. --- ChangeLog | 9 +++++++++ gst/playback/gstdecodebin.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index e3e581c739..a785bf5353 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-22 Wim Taymans + + Patch by: Sjoerd Simons + + * gst/playback/gstdecodebin.c: (remove_fakesink): + Lock the fakesink before setting the state to NULL and removing it from + the bin so that a concurrent state change cannot interfere. + Fixes #534331. + 2008-05-21 Felipe Contreras * docs/Makefile.am: diff --git a/gst/playback/gstdecodebin.c b/gst/playback/gstdecodebin.c index 0f2e8dd79d..de754bd8c2 100644 --- a/gst/playback/gstdecodebin.c +++ b/gst/playback/gstdecodebin.c @@ -634,6 +634,9 @@ remove_fakesink (GstDecodeBin * decode_bin) if (decode_bin->fakesink) { GST_DEBUG_OBJECT (decode_bin, "Removing fakesink and marking state dirty"); + /* Lock the state to prevent it from changing state to non-NULL + * before it's removed */ + gst_element_set_locked_state (decode_bin->fakesink, TRUE); /* setting the state to NULL is never async */ gst_element_set_state (decode_bin->fakesink, GST_STATE_NULL); gst_bin_remove (GST_BIN (decode_bin), decode_bin->fakesink);