typedef struct BufferSourceContext {
const AVClass *class;
- AVFrame *queued_frame;
AVRational time_base; ///< time_base to set in the output link
AVRational frame_rate; ///< frame_rate to set in the output link
unsigned nb_failed_requests;
}
}
- av_assert0(s->queued_frame == NULL);
- s->queued_frame = copy;
- if ((ret = ctx->output_pads[0].request_frame(ctx->outputs[0])) < 0)
+ ret = ff_filter_frame(ctx->outputs[0], copy);
+ if (ret < 0) {
+ av_frame_free(©);
return ret;
- av_assert0(s->queued_frame == NULL);
+ }
if ((flags & AV_BUFFERSRC_FLAG_PUSH)) {
ret = push_frame(ctx->graph);
static av_cold void uninit(AVFilterContext *ctx)
{
BufferSourceContext *s = ctx->priv;
- av_assert0(s->queued_frame == NULL);
av_buffer_unref(&s->hw_frames_ctx);
}
AVFrame *frame;
int ret;
- if (!c->queued_frame) {
- if (c->eof)
- return AVERROR_EOF;
- c->nb_failed_requests++;
- return AVERROR(EAGAIN);
- }
- frame = c->queued_frame;
- c->queued_frame = NULL;
- ret = ff_filter_frame(link, frame);
- return ret;
+ if (c->eof)
+ return AVERROR_EOF;
+ c->nb_failed_requests++;
+ return AVERROR(EAGAIN);
}
static const AVFilterPad avfilter_vsrc_buffer_outputs[] = {