aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_asetnsamples.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-03-13 09:55:32 +0100
committerClément Bœsch <ubitux@gmail.com>2013-03-13 19:00:08 +0100
commitdda59d9adcfa8976c0bc68061a15fbe08dfaac6e (patch)
tree19063ac2b86c0a0c1a07acd8dc9f335ce9aadcd6 /libavfilter/af_asetnsamples.c
parentc82bb2815b8f78fd7f178fc8c614edb4b36df9b7 (diff)
downloadffmpeg-dda59d9adcfa8976c0bc68061a15fbe08dfaac6e.tar.gz
lavfi/asetnsamples: raise filter_frame() error.
Diffstat (limited to 'libavfilter/af_asetnsamples.c')
-rw-r--r--libavfilter/af_asetnsamples.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index f995ce98db..08e5279989 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -94,7 +94,7 @@ static int push_samples(AVFilterLink *outlink)
{
ASNSContext *asns = outlink->src->priv;
AVFrame *outsamples = NULL;
- int nb_out_samples, nb_pad_samples;
+ int ret, nb_out_samples, nb_pad_samples;
if (asns->pad) {
nb_out_samples = av_audio_fifo_size(asns->fifo) ? asns->nb_out_samples : 0;
@@ -125,7 +125,9 @@ static int push_samples(AVFilterLink *outlink)
if (asns->next_out_pts != AV_NOPTS_VALUE)
asns->next_out_pts += nb_out_samples;
- ff_filter_frame(outlink, outsamples);
+ ret = ff_filter_frame(outlink, outsamples);
+ if (ret < 0)
+ return ret;
asns->req_fullfilled = 1;
return nb_out_samples;
}
@@ -168,9 +170,11 @@ static int request_frame(AVFilterLink *outlink)
ret = ff_request_frame(inlink);
} while (!asns->req_fullfilled && ret >= 0);
- if (ret == AVERROR_EOF)
- while (push_samples(outlink))
- ;
+ if (ret == AVERROR_EOF) {
+ do {
+ ret = push_samples(outlink);
+ } while (ret > 0);
+ }
return ret;
}