[vlc-devel] [PATCH] avcodec: only assume DXVA2 is used if it's forced

Steve Lhomme robux4 at videolabs.io
Mon Mar 30 18:44:31 CEST 2015


I see, https://mailman.videolan.org/pipermail/vlc-devel/2014-August/099420.html

So what you're saying is that it should be done differently ? I agree on that.

Since at this point we know the input format, we could check if dxva2
will actually be able to handle, using the regular module loading and
decide if we want FF_THREAD_FRAME or not.

Another way could be to let avcodec pick it's decoder first and if
it's DXVA2 then we disable FF_THREAD_FRAME. I'm not sure if it's
possible to do it in that order, but it would be much cleaner and
logical.

Also #14054 has other issues like bad plane alignment, so this change
won't be sufficient. I'm not even sure frame threading is much
superior to slice threading.

Steve

On Mon, Mar 30, 2015 at 5:06 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le lundi 30 mars 2015, 16:44:42 Steve Lhomme a écrit :
>> Fixes #14054 regression in 2.2.0
>
>>
>> --
>> The DXVA2 decoder has a capability of 0, so it's only used when explicitly
>> forced. ---
>>  modules/codec/avcodec/video.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
>> index 366066c..07a3b4b 100644
>> --- a/modules/codec/avcodec/video.c
>> +++ b/modules/codec/avcodec/video.c
>> @@ -403,7 +403,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext
>> *p_context, * causes major image corruption. */
>>  # if defined(_WIN32)
>>      char *avcodec_hw = var_InheritString( p_dec, "avcodec-hw" );
>> -    if( avcodec_hw == NULL || strcasecmp( avcodec_hw, "none" ) )
>> +    if( avcodec_hw != NULL && !strcasecmp( avcodec_hw, "dxva2" ) )
>>      {
>>          msg_Warn( p_dec, "threaded frame decoding is not compatible with
>> DXVA2, disabled" ); p_context->thread_type &= ~FF_THREAD_FRAME;
>
> I am not going to repeat the objections made to bf9b9955 since that would not
> have been merged if anybody cared.
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list