From adf0c30ae2fd2d4466f89ed7c4fb795d39ce657a Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Mon, 20 Feb 2023 12:21:53 +0100 Subject: [PATCH] file vidcap: Fix inverted condition We don't want to use swscale if we have a valid conversion. Fixes GH-296 --- src/video_capture/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_capture/file.c b/src/video_capture/file.c index 8c5f43e4b..25328613d 100644 --- a/src/video_capture/file.c +++ b/src/video_capture/file.c @@ -605,7 +605,7 @@ static int vidcap_file_init(struct vidcap_params *params, void **state) { s->video_desc.color_spec = UYVY; // fallback, swscale will perhaps be used } - if ((s->conv_uv = get_av_to_uv_conversion(s->vid_ctx->pix_fmt, s->video_desc.color_spec)).valid) { + if (!(s->conv_uv = get_av_to_uv_conversion(s->vid_ctx->pix_fmt, s->video_desc.color_spec)).valid) { s->sws_ctx = sws_getContext(s->video_desc.width, s->video_desc.height, s->vid_ctx->pix_fmt, s->video_desc.width, s->video_desc.height, get_ug_to_av_pixfmt(s->video_desc.color_spec), 0, NULL, NULL, NULL);