mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-26 20:50:34 +00:00
update libavfilter/af_afwtdn.c.
add patch Signed-off-by: ziyugao <gaoziyu0614@outlook.com>
This commit is contained in:
parent
7df0eac0c1
commit
02672a33b3
@ -410,6 +410,7 @@ typedef struct AudioFWTDNContext {
|
||||
|
||||
uint64_t sn;
|
||||
int64_t eof_pts;
|
||||
int eof;
|
||||
|
||||
int wavelet_type;
|
||||
int channels;
|
||||
@ -1071,7 +1072,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||
s->drop_samples = 0;
|
||||
} else {
|
||||
if (s->padd_samples < 0 && eof) {
|
||||
out->nb_samples += s->padd_samples;
|
||||
out->nb_samples = FFMAX(0, out->nb_samples + s->padd_samples);
|
||||
s->padd_samples = 0;
|
||||
}
|
||||
if (!eof)
|
||||
@ -1210,22 +1211,24 @@ static int activate(AVFilterContext *ctx)
|
||||
|
||||
FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink);
|
||||
|
||||
ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
return filter_frame(inlink, in);
|
||||
if (!s->eof) {
|
||||
ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (ret > 0)
|
||||
return filter_frame(inlink, in);
|
||||
}
|
||||
|
||||
if (ff_inlink_acknowledge_status(inlink, &status, &pts)) {
|
||||
if (status == AVERROR_EOF) {
|
||||
while (s->padd_samples != 0) {
|
||||
ret = filter_frame(inlink, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
ff_outlink_set_status(outlink, status, pts);
|
||||
return ret;
|
||||
}
|
||||
if (status == AVERROR_EOF)
|
||||
s->eof = 1;
|
||||
}
|
||||
|
||||
if (s->eof && s->padd_samples != 0) {
|
||||
return filter_frame(inlink, NULL);
|
||||
} else if (s->eof) {
|
||||
ff_outlink_set_status(outlink, AVERROR_EOF, s->eof_pts);
|
||||
return 0;
|
||||
}
|
||||
FF_FILTER_FORWARD_WANTED(outlink, inlink);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user