mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 22:05:58 +00:00
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.
This commit is contained in:
parent
76f715cb8b
commit
d58f4fcf48
1 changed files with 4 additions and 1 deletions
|
@ -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 *
|
||||
|
|
Loading…
Reference in a new issue