Commit 48ec8b25 authored by Nicolas George's avatar Nicolas George

lavfi/af_volumedetect: print stats in uninit().

If the stats are printed when request_frame on the input
returns EOF, then they are never printed if the filter is
not flushed, in particular when using the -t ffmpeg option.

Fix trac ticket #1727.
parent ce028ab9
...@@ -126,13 +126,9 @@ static void print_stats(AVFilterContext *ctx) ...@@ -126,13 +126,9 @@ static void print_stats(AVFilterContext *ctx)
} }
} }
static int request_frame(AVFilterLink *outlink) static void uninit(AVFilterContext *ctx)
{ {
AVFilterContext *ctx = outlink->src;
int ret = ff_request_frame(ctx->inputs[0]);
if (ret == AVERROR_EOF)
print_stats(ctx); print_stats(ctx);
return ret;
} }
AVFilter avfilter_af_volumedetect = { AVFilter avfilter_af_volumedetect = {
...@@ -141,6 +137,7 @@ AVFilter avfilter_af_volumedetect = { ...@@ -141,6 +137,7 @@ AVFilter avfilter_af_volumedetect = {
.priv_size = sizeof(VolDetectContext), .priv_size = sizeof(VolDetectContext),
.query_formats = query_formats, .query_formats = query_formats,
.uninit = uninit,
.inputs = (const AVFilterPad[]) { .inputs = (const AVFilterPad[]) {
{ .name = "default", { .name = "default",
...@@ -152,8 +149,7 @@ AVFilter avfilter_af_volumedetect = { ...@@ -152,8 +149,7 @@ AVFilter avfilter_af_volumedetect = {
}, },
.outputs = (const AVFilterPad[]) { .outputs = (const AVFilterPad[]) {
{ .name = "default", { .name = "default",
.type = AVMEDIA_TYPE_AUDIO, .type = AVMEDIA_TYPE_AUDIO, },
.request_frame = request_frame, },
{ .name = NULL } { .name = NULL }
}, },
}; };
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