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
@ -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…
x
Reference in New Issue
Block a user