From 1b3ba87d137d64306fb3f2a1bdf980acafa5d60c Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 17 Dec 2020 04:41:18 +1100 Subject: [PATCH] audiobuffersplit: Calculate the correct size for fixed size buffers Fix the output-buffer-size property to do what it says by calculating the correct audio buffer size for that target size, rounded down to the nearest whole number of samples. Part-of: --- gst/audiobuffersplit/gstaudiobuffersplit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/audiobuffersplit/gstaudiobuffersplit.c b/gst/audiobuffersplit/gstaudiobuffersplit.c index 68bf40d195..911c598246 100644 --- a/gst/audiobuffersplit/gstaudiobuffersplit.c +++ b/gst/audiobuffersplit/gstaudiobuffersplit.c @@ -230,8 +230,9 @@ gst_audio_buffer_split_update_samples_per_buffer (GstAudioBufferSplit * self) } if (self->output_buffer_size) { - self->output_buffer_duration_n = GST_AUDIO_INFO_BPF (&self->info); - self->output_buffer_duration_d = self->output_buffer_size; + self->output_buffer_duration_n = + self->output_buffer_size / GST_AUDIO_INFO_BPF (&self->info); + self->output_buffer_duration_d = GST_AUDIO_INFO_RATE (&self->info); } self->samples_per_buffer =