[FFmpeg-devel] [PATCH 7/7] avcodec/mpegvideo_enc: Don't pretend ff_dct_encode_init() can fail

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Jun 9 12:54:38 EEST 2024


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/mpegvideo_enc.c | 4 +---
 libavcodec/mpegvideoenc.h  | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index b7c1f08b0f..46ef693abe 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -290,7 +290,7 @@ static void mpv_encode_defaults(MpegEncContext *s)
     s->picture_in_gop_number = 0;
 }
 
-av_cold int ff_dct_encode_init(MpegEncContext *s)
+av_cold void ff_dct_encode_init(MpegEncContext *s)
 {
     s->dct_quantize = dct_quantize_c;
     s->denoise_dct  = denoise_dct_c;
@@ -303,8 +303,6 @@ av_cold int ff_dct_encode_init(MpegEncContext *s)
 
     if (s->avctx->trellis)
         s->dct_quantize  = dct_quantize_trellis_c;
-
-    return 0;
 }
 
 /* init video encoder */
diff --git a/libavcodec/mpegvideoenc.h b/libavcodec/mpegvideoenc.h
index abbcdbc8fa..0a9e65e93a 100644
--- a/libavcodec/mpegvideoenc.h
+++ b/libavcodec/mpegvideoenc.h
@@ -145,7 +145,7 @@ int ff_mpv_reallocate_putbitbuffer(MpegEncContext *s, size_t threshold, size_t s
 
 void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix);
 
-int ff_dct_encode_init(MpegEncContext *s);
+void ff_dct_encode_init(MpegEncContext *s);
 void ff_mpvenc_dct_init_mips(MpegEncContext *s);
 void ff_dct_encode_init_x86(MpegEncContext *s);
 
-- 
2.40.1



More information about the ffmpeg-devel mailing list