[FFmpeg-devel] [PATCHv3] avfilter/vf_framerate: always request input if no output is provided in request_frame
Marton Balint
cus at passwd.hu
Wed Apr 12 22:23:32 EEST 2017
On Sat, 8 Apr 2017, Marton Balint wrote:
> Fixes ticket #6285.
>
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
> libavfilter/vf_framerate.c | 42 ++++++++++++++++++++++++++----------------
> 1 file changed, 26 insertions(+), 16 deletions(-)
Applied this as well.
> @@ -695,7 +689,23 @@ static int request_frame(AVFilterLink *outlink)
> }
>
> set_work_frame_pts(ctx);
> - return process_work_frame(ctx, 0);
> + ret = process_work_frame(ctx, 0);
> + if (ret < 0)
> + return ret;
> + if (ret)
> + return ff_filter_frame(ctx->outputs[0], s->work);
> +
> +request:
> + ff_dlog(ctx, "request_frame() call source's request_frame()\n");
> + ret = ff_request_frame(ctx->inputs[0]);
> + if (ret < 0 && (ret != AVERROR_EOF)) {
> + ff_dlog(ctx, "request_frame() source's request_frame() returned error:%d\n", ret);
> + return ret;
> + } else if (ret == AVERROR_EOF) {
> + s->flush = 1;
> + }
> + ff_dlog(ctx, "request_frame() source's request_frame() returned:%d\n", ret);
> + return 0;
> }
Note that the above code which I moved returns 0 if ff_request_frame
returns AVERROR_EOF. As far as I see, this can only happen a few times,
not infinitely, so I am not sure if this is an error or not, so I kept is
as it was before.
Regards,
Marton
More information about the ffmpeg-devel
mailing list