summaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-03-31 19:34:35 +0200
committerNicolas George <nicolas.george@normalesup.org>2013-04-03 17:44:10 +0200
commitb570f24d7600ef4c8f05018c46bea6356927ba4d (patch)
treeccf4667f133442038cf8b70e0166b904cfcd70a6 /libavfilter
parent9566ba91abf42de473b35ac7ef68441eb91189b5 (diff)
downloadffmpeg-streaming-b570f24d7600ef4c8f05018c46bea6356927ba4d.zip
ffmpeg-streaming-b570f24d7600ef4c8f05018c46bea6356927ba4d.tar.gz
lavfi/af_asetnsamples: simplify request_frame loop.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_asetnsamples.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index e004453..9a10baa 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -38,7 +38,6 @@ typedef struct {
int nb_out_samples; ///< how many samples to output
AVAudioFifo *fifo; ///< samples are queued here
int64_t next_out_pts;
- int req_fullfilled;
int pad;
} ASNSContext;
@@ -86,6 +85,7 @@ static int config_props_output(AVFilterLink *outlink)
asns->fifo = av_audio_fifo_alloc(outlink->format, nb_channels, asns->nb_out_samples);
if (!asns->fifo)
return AVERROR(ENOMEM);
+ outlink->flags |= FF_LINK_FLAG_REQUEST_LOOP;
return 0;
}
@@ -128,7 +128,6 @@ static int push_samples(AVFilterLink *outlink)
ret = ff_filter_frame(outlink, outsamples);
if (ret < 0)
return ret;
- asns->req_fullfilled = 1;
return nb_out_samples;
}
@@ -161,15 +160,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
static int request_frame(AVFilterLink *outlink)
{
- ASNSContext *asns = outlink->src->priv;
AVFilterLink *inlink = outlink->src->inputs[0];
int ret;
- asns->req_fullfilled = 0;
- do {
- ret = ff_request_frame(inlink);
- } while (!asns->req_fullfilled && ret >= 0);
-
+ ret = ff_request_frame(inlink);
if (ret == AVERROR_EOF) {
ret = push_samples(outlink);
return ret < 0 ? ret : ret > 0 ? 0 : AVERROR_EOF;
OpenPOWER on IntegriCloud