diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c index e0431b1b3e..efcb0426e4 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -446,9 +446,7 @@ static int v4l2_get_raw_format(V4L2Context* ctx, enum AVPixelFormat *p) if (pixfmt != AV_PIX_FMT_NONE) { ret = v4l2_try_raw_format(ctx, pixfmt); - if (ret) - pixfmt = AV_PIX_FMT_NONE; - else + if (!ret) return 0; }