From 78a8531c7539dda7c22ca4b9bbd238c9c337005f Mon Sep 17 00:00:00 2001 From: Paul HENRYS Date: Fri, 22 Mar 2013 13:41:17 +0100 Subject: [PATCH] audiobasesrc: Fix ringbuffer handling when settings caps ringbuffer was released after setting values to its spec field in gst_audio_base_src_setcaps(). This led to failure in case gst_audio_base_src_setcaps() is called more than one time. https://bugzilla.gnome.org/show_bug.cgi?id=696540 --- gst-libs/gst/audio/gstaudiobasesrc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/audio/gstaudiobasesrc.c b/gst-libs/gst/audio/gstaudiobasesrc.c index 66bade45f8..8f1721bb09 100644 --- a/gst-libs/gst/audio/gstaudiobasesrc.c +++ b/gst-libs/gst/audio/gstaudiobasesrc.c @@ -534,6 +534,9 @@ gst_audio_base_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps) GstAudioRingBufferSpec *spec; gint bpf, rate; + GST_DEBUG ("release old ringbuffer"); + gst_audio_ring_buffer_release (src->ringbuffer); + spec = &src->ringbuffer->spec; spec->buffer_time = src->buffer_time; @@ -554,10 +557,6 @@ gst_audio_base_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps) GST_OBJECT_UNLOCK (src); - GST_DEBUG ("release old ringbuffer"); - - gst_audio_ring_buffer_release (src->ringbuffer); - gst_audio_ring_buffer_debug_spec_buff (spec); GST_DEBUG ("acquire new ringbuffer");