mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-22 23:33:11 +00:00
af_aresample: fix request_frame()
Fixes part of Ticket1341 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ca8623e1a5
commit
411689b5e1
@ -37,6 +37,7 @@ typedef struct {
|
|||||||
double ratio;
|
double ratio;
|
||||||
struct SwrContext *swr;
|
struct SwrContext *swr;
|
||||||
int64_t next_pts;
|
int64_t next_pts;
|
||||||
|
int req_fullfilled;
|
||||||
} AResampleContext;
|
} AResampleContext;
|
||||||
|
|
||||||
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
|
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
|
#endif
|
||||||
ff_filter_samples(outlink, outsamplesref);
|
ff_filter_samples(outlink, outsamplesref);
|
||||||
|
aresample->req_fullfilled= 1;
|
||||||
avfilter_unref_buffer(insamplesref);
|
avfilter_unref_buffer(insamplesref);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,7 +218,12 @@ static int request_frame(AVFilterLink *outlink)
|
|||||||
AVFilterContext *ctx = outlink->src;
|
AVFilterContext *ctx = outlink->src;
|
||||||
AResampleContext *aresample = ctx->priv;
|
AResampleContext *aresample = ctx->priv;
|
||||||
AVFilterLink *const inlink = outlink->src->inputs[0];
|
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) {
|
if (ret == AVERROR_EOF) {
|
||||||
AVFilterBufferRef *outsamplesref;
|
AVFilterBufferRef *outsamplesref;
|
||||||
|
Loading…
Reference in New Issue
Block a user