aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-05-10 09:25:38 +0200
committerPaul B Mahol <onemda@gmail.com>2022-05-10 09:27:10 +0200
commit38238b604fb59ebaafe93dcf72e544cb33c4ac70 (patch)
tree56cff21e8ddc5e703ca4054d8fec53457e9d16c2
parent467f157fc65045a7a60b0360d4503ba1e665da0a (diff)
downloadffmpeg-38238b604fb59ebaafe93dcf72e544cb33c4ac70.tar.gz
avfilter/af_biquads: use correct variables when reversing samples
Also silence initial block frames.
-rw-r--r--libavfilter/af_biquads.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 2ec32e915d..060569948a 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -793,6 +793,9 @@ static int config_filter(AVFilterLink *outlink, int reset)
s->block[i] = ff_get_audio_buffer(outlink, s->block_samples * 2);
if (!s->block[i])
return AVERROR(ENOMEM);
+ av_samples_set_silence(s->block[i]->extended_data, 0, s->block_samples * 2,
+ s->block[i]->ch_layout.nb_channels, s->block[i]->format);
+
}
}
@@ -927,14 +930,14 @@ static void reverse_samples(AVFrame *out, AVFrame *in, int p,
{
switch (out->format) {
case AV_SAMPLE_FMT_S16P: {
- const int16_t *src = ((const int16_t *)out->extended_data[p]) + io;
+ const int16_t *src = ((const int16_t *)in->extended_data[p]) + io;
int16_t *dst = ((int16_t *)out->extended_data[p]) + oo;
for (int i = 0, j = nb_samples - 1; i < nb_samples; i++, j--)
dst[i] = src[j];
}
break;
case AV_SAMPLE_FMT_S32P: {
- const int32_t *src = ((const int32_t *)out->extended_data[p]) + io;
+ const int32_t *src = ((const int32_t *)in->extended_data[p]) + io;
int32_t *dst = ((int32_t *)out->extended_data[p]) + oo;
for (int i = 0, j = nb_samples - 1; i < nb_samples; i++, j--)
dst[i] = src[j];