mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
audiobasesink: fix ring buffer leak on open failure
This commit is contained in:
parent
4e6b917ba3
commit
5cb40d7320
1 changed files with 6 additions and 1 deletions
|
@ -2225,8 +2225,13 @@ gst_audio_base_sink_change_state (GstElement * element,
|
||||||
sink->ringbuffer = rb;
|
sink->ringbuffer = rb;
|
||||||
GST_OBJECT_UNLOCK (sink);
|
GST_OBJECT_UNLOCK (sink);
|
||||||
|
|
||||||
if (!gst_audio_ring_buffer_open_device (sink->ringbuffer))
|
if (!gst_audio_ring_buffer_open_device (sink->ringbuffer)) {
|
||||||
|
GST_OBJECT_LOCK (sink);
|
||||||
|
gst_object_unparent (GST_OBJECT_CAST (sink->ringbuffer));
|
||||||
|
sink->ringbuffer = NULL;
|
||||||
|
GST_OBJECT_UNLOCK (sink);
|
||||||
goto open_failed;
|
goto open_failed;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
|
|
Loading…
Reference in a new issue