audiosink: free the ringbuffer when going to NULL
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 17 Jun 2009 11:18:18 +0000 (13:18 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 17 Jun 2009 11:18:18 +0000 (13:18 +0200)
Unparent and free the ringbuffer when going to NULL, like we do with the
audiosrc element. We can do this now because we correctly manage the time
jumping back to 0.

gst-libs/gst/audio/gstbaseaudiosink.c

index a347ec2838d002d7153296117279489d4e258607..7007e4e3a363c77ece230aa7568dcc776f6bd796 100644 (file)
@@ -1804,12 +1804,10 @@ gst_base_audio_sink_change_state (GstElement * element,
       gst_ring_buffer_activate (sink->ringbuffer, FALSE);
       gst_ring_buffer_release (sink->ringbuffer);
       gst_ring_buffer_close_device (sink->ringbuffer);
-#if 0
       GST_OBJECT_LOCK (sink);
       gst_object_unparent (GST_OBJECT_CAST (sink->ringbuffer));
       sink->ringbuffer = NULL;
       GST_OBJECT_UNLOCK (sink);
-#endif
       break;
     default:
       break;