Commit 01170e9d authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_headphone: fix flushing

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 2b0f821f
......@@ -742,7 +742,20 @@ static int request_frame(AVFilterLink *outlink)
s->eof_hrirs = 1;
}
}
return ff_request_frame(ctx->inputs[0]);
ret = ff_request_frame(ctx->inputs[0]);
if (ret == AVERROR_EOF && av_audio_fifo_size(s->in[0].fifo) > 0 && s->have_hrirs) {
AVFrame *in = ff_get_audio_buffer(outlink, s->size);
ret = av_audio_fifo_write(s->in[0].fifo, (void **)in->extended_data,
in->nb_samples);
if (ret < 0)
return ret;
ret = headphone_frame(s, outlink);
av_audio_fifo_drain(s->in[0].fifo, av_audio_fifo_size(s->in[0].fifo));
}
return ret;
}
static av_cold void uninit(AVFilterContext *ctx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment