[FFmpeg-cvslog] avcodec/snowenc: Remove redundant pixel format check

Andreas Rheinhardt git at videolan.org
Sat Oct 2 17:59:27 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Sep 28 14:10:21 2021 +0200| [be6da2f25257805d3a8aa4c112a77b144b30f4b2] | committer: Andreas Rheinhardt

avcodec/snowenc: Remove redundant pixel format check

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

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be6da2f25257805d3a8aa4c112a77b144b30f4b2
---

 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);



More information about the ffmpeg-cvslog mailing list