From 61c1d15ce775a8ccfd9a3cec7cb2a6e47af62ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 14 Aug 2013 15:43:23 +0200 Subject: [PATCH] playsink: Don't set sink to NULL if a new one is set while the old one is still in use --- gst/playback/gstplaysink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 8c025a4572..aa44feef67 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -842,7 +842,8 @@ gst_play_sink_set_sink (GstPlaySink * playsink, GstPlaySinkType type, GST_PLAY_SINK_UNLOCK (playsink); if (old) { - if (old != sink) + /* Set the old sink to NULL if it is not used any longer */ + if (old != sink && !GST_OBJECT_PARENT (old)) gst_element_set_state (old, GST_STATE_NULL); gst_object_unref (old); }