[vlc-commits] avcodec: remove avcodec-fast support

Marvin Scholz git at videolan.org
Wed Jun 10 14:51:41 CEST 2020


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Jun  5 00:09:07 2020 +0200| [312c06ef52d8744b596c5deb56a8ac28bca47588] | committer: Marvin Scholz

avcodec: remove avcodec-fast support

The avcodec-fast option, if enabled, sets the AV_CODEC_FLAG2_FAST
option. Using AV_CODEC_FLAG2_FAST can cause use of unsafe code in
avcodec which could lead to crashes.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=312c06ef52d8744b596c5deb56a8ac28bca47588
---

 modules/codec/avcodec/avcodec.c | 2 +-
 modules/codec/avcodec/avcodec.h | 4 ----
 modules/codec/avcodec/video.c   | 3 ---
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index ad2201cb1f..dc2d3d3550 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -118,7 +118,7 @@ vlc_module_begin ()
     add_obsolete_integer( "avcodec-vismv" ) /* removed since 3.0.0 */
     add_obsolete_integer ( "ffmpeg-lowres" ) /* removed since 2.1.0 */
     add_obsolete_bool( "ffmpeg-fast" ) /* removed since 2.1.0 */
-    add_bool( "avcodec-fast", false, FAST_TEXT, FAST_LONGTEXT, false )
+    add_obsolete_bool( "avcodec-fast" ) /* removed since 4.0.0 */
     add_obsolete_integer ( "ffmpeg-skiploopfilter" ) /* removed since 2.1.0 */
     add_integer ( "avcodec-skiploopfilter", 0, SKIPLOOPF_TEXT,
                   SKIPLOOPF_LONGTEXT, false)
diff --git a/modules/codec/avcodec/avcodec.h b/modules/codec/avcodec/avcodec.h
index 1df39c613a..184ceb11d7 100644
--- a/modules/codec/avcodec/avcodec.h
+++ b/modules/codec/avcodec/avcodec.h
@@ -84,10 +84,6 @@ int ffmpeg_OpenCodec( decoder_t *p_dec, AVCodecContext *, const AVCodec * );
     "when there is not enough time. It's useful with low CPU power " \
     "but it can produce distorted pictures.")
 
-#define FAST_TEXT N_("Allow speed tricks")
-#define FAST_LONGTEXT N_( \
-    "Allow non specification compliant speedup tricks. Faster but error-prone.")
-
 #define SKIP_FRAME_TEXT N_("Skip frame (default=0)")
 #define SKIP_FRAME_LONGTEXT N_( \
     "Force skipping of frames to speed up decoding " \
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index c359dffe57..b74d77e0f5 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -573,9 +573,6 @@ int InitVideoDec( vlc_object_t *obj )
     else if( i_val == 1 ) p_context->skip_loop_filter = AVDISCARD_NONREF;
     else p_context->skip_loop_filter = AVDISCARD_DEFAULT;
 
-    if( var_CreateGetBool( p_dec, "avcodec-fast" ) )
-        p_context->flags2 |= AV_CODEC_FLAG2_FAST;
-
     /* ***** libavcodec frame skipping ***** */
     p_sys->b_hurry_up = var_CreateGetBool( p_dec, "avcodec-hurry-up" );
     p_sys->b_show_corrupted = var_CreateGetBool( p_dec, "avcodec-corrupted" );



More information about the vlc-commits mailing list