mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
audiobasesrc: Avoid unnecessary configuration
Port a change from audiobasesink from def07410
, to ignore setcaps
when the caps don't actually change, and avoid a reconfiguration
and reset of the ringbuffer in that case.
This commit is contained in:
parent
472ded1cf3
commit
f0b655e1ad
1 changed files with 8 additions and 2 deletions
|
@ -536,11 +536,17 @@ gst_audio_base_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
|
|||
GstAudioRingBufferSpec *spec;
|
||||
gint bpf, rate;
|
||||
|
||||
spec = &src->ringbuffer->spec;
|
||||
|
||||
if (G_UNLIKELY (spec->caps && gst_caps_is_equal (spec->caps, caps))) {
|
||||
GST_DEBUG_OBJECT (src,
|
||||
"Ringbuffer caps haven't changed, skipping reconfiguration");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GST_DEBUG ("release old ringbuffer");
|
||||
gst_audio_ring_buffer_release (src->ringbuffer);
|
||||
|
||||
spec = &src->ringbuffer->spec;
|
||||
|
||||
spec->buffer_time = src->buffer_time;
|
||||
spec->latency_time = src->latency_time;
|
||||
|
||||
|
|
Loading…
Reference in a new issue