aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-26 02:28:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-26 02:59:22 +0200
commit484302d183877bf0dbba616d5e3d3526be00653d (patch)
treeece877d634779073fa0df714f88fbbc87ca74083
parent734cfa8e8bb66d7a5ae69066fdd219e0a517027d (diff)
downloadffmpeg-484302d183877bf0dbba616d5e3d3526be00653d.tar.gz
af_aresample: fix request_frame()
Fixes part of Ticket1341 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 411689b5e1189e325f12060e52e7c5cb29f87b21) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/af_aresample.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 30d6f6ad40..aab118b778 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -37,6 +37,7 @@ typedef struct {
double ratio;
struct SwrContext *swr;
int64_t next_pts;
+ int req_fullfilled;
} AResampleContext;
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
@@ -208,6 +209,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
}
#endif
ff_filter_samples(outlink, outsamplesref);
+ aresample->req_fullfilled= 1;
avfilter_unref_buffer(insamplesref);
}
@@ -216,7 +218,12 @@ static int request_frame(AVFilterLink *outlink)
AVFilterContext *ctx = outlink->src;
AResampleContext *aresample = ctx->priv;
AVFilterLink *const inlink = outlink->src->inputs[0];
- int ret = avfilter_request_frame(ctx->inputs[0]);
+ int ret;
+
+ aresample->req_fullfilled = 0;
+ do{
+ ret = avfilter_request_frame(ctx->inputs[0]);
+ }while(!aresample->req_fullfilled && ret>=0);
if (ret == AVERROR_EOF) {
AVFilterBufferRef *outsamplesref;