[vlc-devel] [PATCH] avcodec: only disable frame threading if DXVA2 is likely to be used
Steve Lhomme
robux4 at videolabs.io
Wed Apr 1 12:58:04 CEST 2015
On Wed, Apr 1, 2015 at 12:44 PM, Jean-Baptiste Kempf <jb at videolan.org> wrote:
> 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?
I could pass a flag to tell to just check for the format without
deleting the previous p_va. Or do a separate function to just check
the right format.
That would make logs a little less verbose too.
More information about the vlc-devel
mailing list