[vlc-commits] [Git][videolan/vlc][master] avcodec: remove deprecated FF_MAX_B_FRAMES compat define

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Apr 19 12:03:51 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
768cb3de by ARPIT-NAYAK-LEGEND at 2026-04-19T13:33:12+02:00
avcodec: remove deprecated FF_MAX_B_FRAMES compat define

FF_MAX_B_FRAMES was removed from FFmpeg headers as there is no longer
a global libavcodec-wide limit on B-frames. Remove the compat define
from avcommon_compat.h and drop the arbitrary upper bound clamp in
encoder.c, letting libavcodec's per-encoder validation handle limits.

- - - - -


2 changed files:

- modules/codec/avcodec/avcommon_compat.h
- modules/codec/avcodec/encoder.c


Changes:

=====================================
modules/codec/avcodec/avcommon_compat.h
=====================================
@@ -69,9 +69,7 @@
 #ifndef AV_CODEC_CAP_SMALL_LAST_FRAME
 # define AV_CODEC_CAP_SMALL_LAST_FRAME CODEC_CAP_SMALL_LAST_FRAME
 #endif
-#ifndef  FF_MAX_B_FRAMES
-# define  FF_MAX_B_FRAMES 16 // FIXME: remove this
-#endif
+
 #ifndef FF_API_AVIO_WRITE_NONCONST // removed in ffmpeg 7
 # define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61)
 #endif


=====================================
modules/codec/avcodec/encoder.c
=====================================
@@ -558,7 +558,7 @@ int InitVideoEnc( vlc_object_t *p_this )
         if( p_sys->i_key_int > 0 )
             p_context->gop_size = p_sys->i_key_int;
         p_context->max_b_frames =
-            VLC_CLIP( p_sys->i_b_frames, 0, FF_MAX_B_FRAMES );
+            __MAX( p_sys->i_b_frames, 0 );
         if( !p_context->max_b_frames  &&
             (  p_enc->fmt_out.i_codec == VLC_CODEC_MPGV ||
                p_enc->fmt_out.i_codec == VLC_CODEC_MP2V ) )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/768cb3defa29ed7a93af852fbd77a9503050c503

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/768cb3defa29ed7a93af852fbd77a9503050c503
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list