[FFmpeg-devel] [PATCH 3/9] avcodec/snowenc: Remove redundant pixel format check

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue Sep 28 17:41:11 EEST 2021


ff_encode_preinit() already checked the pixel format via
AVCodec.pix_fmts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/snowenc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 55ebfba50f..96b0d320bc 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -120,17 +120,12 @@ static av_cold int encode_init(AVCodecContext *avctx)
 /*    case AV_PIX_FMT_RGB32:
         s->colorspace= 1;
         break;*/
-    default:
-        av_log(avctx, AV_LOG_ERROR, "pixel format not supported\n");
-        return AVERROR_PATCHWELCOME;
     }
 
     ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift,
                                            &s->chroma_v_shift);
-    if (ret) {
-        av_log(avctx, AV_LOG_ERROR, "pixel format invalid or unknown\n");
+    if (ret)
         return ret;
-    }
 
     ff_set_cmp(&s->mecc, s->mecc.me_cmp, s->avctx->me_cmp);
     ff_set_cmp(&s->mecc, s->mecc.me_sub_cmp, s->avctx->me_sub_cmp);
-- 
2.30.2



More information about the ffmpeg-devel mailing list