]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mpegvideo_enc: Combine identical checks
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Tue, 6 Apr 2021 14:00:28 +0000 (16:00 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sat, 10 Apr 2021 01:56:33 +0000 (03:56 +0200)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavcodec/mpegvideo_enc.c

index 0a1d0db86de953cb0067974e768d1146724aabfc..e5411f0393bb6d2db1bbd869f3c7b5fd36cda8be 100644 (file)
@@ -527,10 +527,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
         return AVERROR(EINVAL);
     }
     if ((s->codec_id == AV_CODEC_ID_H263  ||
-         s->codec_id == AV_CODEC_ID_H263P) &&
+         s->codec_id == AV_CODEC_ID_H263P ||
+         s->codec_id == AV_CODEC_ID_RV20) &&
         ((avctx->width &3) ||
          (avctx->height&3) )) {
-        av_log(avctx, AV_LOG_ERROR, "w/h must be a multiple of 4\n");
+        av_log(avctx, AV_LOG_ERROR, "width and height must be a multiple of 4\n");
         return AVERROR(EINVAL);
     }
 
@@ -541,13 +542,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
         return AVERROR(EINVAL);
     }
 
-    if (s->codec_id == AV_CODEC_ID_RV20 &&
-        (avctx->width &3 ||
-         avctx->height&3 )) {
-        av_log(avctx, AV_LOG_ERROR, "width and height must be a multiple of 4\n");
-        return AVERROR(EINVAL);
-    }
-
     if ((s->codec_id == AV_CODEC_ID_WMV1 ||
          s->codec_id == AV_CODEC_ID_WMV2) &&
          avctx->width & 1) {