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
This commit is contained in:
Paul HENRYS 2013-03-22 13:41:17 +01:00 committed by Sebastian Dröge
parent 052a1d0f1e
commit 78a8531c75

View file

@ -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");