[vlc-devel] [PATCH] avcodec: only disable frame threading if DXVA2 is likely to be used

Jean-Baptiste Kempf jb at videolan.org
Wed Apr 1 12:44:56 CEST 2015


On 31 Mar, Steve Lhomme wrote :
> +# if defined(_WIN32)
>      /* Workaround: frame multithreading is not compatible with
>       * DXVA2. When a frame is being copied to host memory, the frame
>       * is locked and cannot be used as a reference frame
>       * simultaneously and thus decoding fails for some frames. This
>       * causes major image corruption. */
> -# if defined(_WIN32)
> -    char *avcodec_hw = var_InheritString( p_dec, "avcodec-hw" );
> -    if( avcodec_hw == NULL || strcasecmp( avcodec_hw, "none" ) )
> +    enum PixelFormat test_formats[] = { AV_PIX_FMT_DXVA2_VLD, AV_PIX_FMT_NONE };
> +    if( AV_PIX_FMT_DXVA2_VLD == ffmpeg_GetFormat( p_context, &test_formats ) )

Are you sure calling ffmpeg_GetFormat from here is a good idea?
IIRC ffmpeg_GetFormat was first deleting any existing p_va and so on...
Is it safe?

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list