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 <sjoerd at luon dot net>
* 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.
This commit is contained in:
Sjoerd Simons 2008-05-22 11:59:33 +00:00 committed by Wim Taymans
parent 75d05dc499
commit 1c424d9d93
2 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2008-05-22 Wim Taymans <wim.taymans@collabora.co.uk>
Patch by: Sjoerd Simons <sjoerd at luon dot net>
* 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 <felipe.contreras@gmail.com>
* docs/Makefile.am:

View file

@ -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);