diff options
author | Josep Torra Valles <n770galaxy@gmail.com> | 2010-02-12 19:43:13 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-02-12 19:43:13 +0100 |
commit | d58f4fcf48c768607c11597bf83c0e6db469b4b5 (patch) | |
tree | 941061665f8feaa201ada0e92a92ae0dac40a99f | |
parent | 76f715cb8bf4776fe70c47ce66cd58c366fd32e8 (diff) |
playsink: Reset the sink's state to NULL before unreffing it unless it's the same instance again
This makes sure that we don't destroy the last reference before the
element gets back to NULL state. Fixes assertion failures if a playbin2
instance is reused but different sinks are automatically chosen because
of different caps.
-rw-r--r-- | gst/playback/gstplaysink.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 9854dd6a..ac70c68e 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -445,8 +445,11 @@ gst_play_sink_set_sink (GstPlaySink * playsink, GstPlaySinkType type, } GST_PLAY_SINK_UNLOCK (playsink); - if (old) + if (old) { + if (old != sink) + gst_element_set_state (old, GST_STATE_NULL); gst_object_unref (old); + } } GstElement * |