1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avfilter/af_dynaudnorm: do not hang forever if only EOF is received

This commit is contained in:
Paul B Mahol 2020-01-01 13:35:31 +01:00
parent 7bb09e57e0
commit d4d6280ab2

View File

@ -67,7 +67,6 @@ typedef struct DynamicAudioNormalizerContext {
double *weights;
int channels;
int delay;
int eof;
int64_t pts;
@ -345,7 +344,6 @@ static int config_input(AVFilterLink *inlink)
init_gaussian_filter(s);
s->channels = inlink->channels;
s->delay = s->filter_size;
return 0;
}
@ -717,7 +715,6 @@ static int flush_buffer(DynamicAudioNormalizerContext *s, AVFilterLink *inlink,
}
}
s->delay--;
return filter_frame(inlink, out);
}
@ -734,7 +731,6 @@ static int flush(AVFilterLink *outlink)
s->pts = out->pts;
ret = ff_filter_frame(outlink, out);
s->delay = s->queue.available;
}
return ret;
@ -772,10 +768,10 @@ static int activate(AVFilterContext *ctx)
s->eof = 1;
}
if (s->eof && s->delay > 0)
if (s->eof && s->queue.available)
return flush(outlink);
if (s->eof && s->delay <= 0) {
if (s->eof && !s->queue.available) {
ff_outlink_set_status(outlink, AVERROR_EOF, s->pts);
return 0;
}