summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosep Torra Valles <n770galaxy@gmail.com>2010-02-12 19:43:13 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-02-12 19:43:13 +0100
commitd58f4fcf48c768607c11597bf83c0e6db469b4b5 (patch)
tree941061665f8feaa201ada0e92a92ae0dac40a99f
parent76f715cb8bf4776fe70c47ce66cd58c366fd32e8 (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.c5
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 *