[vlc-devel] [RFC] [PATCH] avcodec: remove avcodec-fast support

Rémi Denis-Courmont remi at remlab.net
Fri Jun 5 16:50:15 CEST 2020


Le perjantaina 5. kesäkuuta 2020, 1.13.10 EEST Marvin Scholz a écrit :
> 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.
> ---
> 
> It seems a bad idea to haven an option that can enable unsafe code

have*. Could use shorter sentences.

Code LGTM.

> especially with such a option name and description as it does not
> sound at all like it would enable possibly unsafe behavior that can
> lead to crashes.
> 
> Alternatively if we really want to keep it, we probably should
> adjus the name of the option and description to make it clear
> what other effects it has, other than improving speed.
> 
>  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"
> );


-- 
レミ・デニ-クールモン
http://www.remlab.net/





More information about the vlc-devel mailing list