summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul HENRYS <visechelle@gmail.com>2013-03-22 13:41:17 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-03-25 10:16:03 +0100
commit78a8531c7539dda7c22ca4b9bbd238c9c337005f (patch)
treecc451dd48afc84d2a863308200bfa44dc1eb6f35
parent052a1d0f1ea1785ae51b15c5687f98128e04acdf (diff)
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
-rw-r--r--gst-libs/gst/audio/gstaudiobasesrc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gst-libs/gst/audio/gstaudiobasesrc.c b/gst-libs/gst/audio/gstaudiobasesrc.c
index 66bade45f..8f1721bb0 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");