Commit d4d6280a authored by Paul B Mahol's avatar Paul B Mahol

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

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