mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/af_dynaudnorm: make better check for available samples
Also report more correct EOF timestamp.
This commit is contained in:
parent
2ae73b74bb
commit
3e3c408e3f
|
@ -719,6 +719,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||||
cqueue_dequeue(s->is_enabled, &is_enabled);
|
cqueue_dequeue(s->is_enabled, &is_enabled);
|
||||||
|
|
||||||
amplify_frame(s, out, is_enabled > 0.);
|
amplify_frame(s, out, is_enabled > 0.);
|
||||||
|
s->pts = out->pts + out->nb_samples;
|
||||||
ret = ff_filter_frame(outlink, out);
|
ret = ff_filter_frame(outlink, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -769,7 +770,7 @@ static int flush(AVFilterLink *outlink)
|
||||||
} else if (s->queue.available) {
|
} else if (s->queue.available) {
|
||||||
AVFrame *out = ff_bufqueue_get(&s->queue);
|
AVFrame *out = ff_bufqueue_get(&s->queue);
|
||||||
|
|
||||||
s->pts = out->pts;
|
s->pts = out->pts + out->nb_samples;
|
||||||
ret = ff_filter_frame(outlink, out);
|
ret = ff_filter_frame(outlink, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,7 +798,7 @@ static int activate(AVFilterContext *ctx)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ff_inlink_queued_samples(inlink) >= s->frame_len) {
|
if (ff_inlink_check_available_samples(inlink, s->frame_len) > 0) {
|
||||||
ff_filter_set_ready(ctx, 10);
|
ff_filter_set_ready(ctx, 10);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue