[FFmpeg-devel] [PATCHv2] avfilter/vf_framerate: always request input if no output is provided in request_frame

Nicolas George george at nsup.org
Fri Apr 7 11:20:47 EEST 2017


L'octidi 18 germinal, an CCXXV, Marton Balint a écrit :
> Fixes ticket #6285.
> 
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  libavfilter/vf_framerate.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Still LGTM, of course.

But since the questions of elegance have been raised, here are my two
zorkmids:

Another solution that I personally find more elegant (but it is only a
matter of taste) would be to have process_work_frame() return to the
caller whether a frame was sent:

    static int process_work_frame(AVFilterContext *ctx, int stop, int *frame_sent)
	...
	*frame_sent = 1;
	return ff_filter_frame(ctx->outputs[0], s->work);

And then check this variable and call ff_request_frame() from
request_frame() rather than calling it directly from
process_work_frame():

	ret = process_work_frame(ctx, 0, &frame_sent);
	return frame_sent ? ret : ff_request_frame(...)

But it is only a matter of personal preference, and I mention it only in
case you share it; the patch as is looks fine to me.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170407/0031cb58/attachment.sig>


More information about the ffmpeg-devel mailing list