On Wed, Jun 7, 2017 at 12:11 PM, wm4 <[email protected]> wrote:
> On Wed, 7 Jun 2017 09:01:07 +0200
> Steve Lhomme <[email protected]> wrote:
>
>> On Tue, Jun 6, 2017 at 6:51 PM, wm4 <[email protected]> wrote:
>
>> >      do {
>> > +        ff_dxva2_lock(avctx);
>> >  #if CONFIG_D3D11VA
>> > -        if (ff_dxva2_is_d3d11(avctx)) {
>> > -            if (D3D11VA_CONTEXT(ctx)->context_mutex != 
>> > INVALID_HANDLE_VALUE)
>> > -                
>> > WaitForSingleObjectEx(D3D11VA_CONTEXT(ctx)->context_mutex, INFINITE, 
>> > FALSE);
>> > +        if (ff_dxva2_is_d3d11(avctx))
>>
>> Did you mean ff_dxva2_lock() ?
>
> But that call is there? It's still D3D11-only, and does nothing with
> DXVA2. I thought it'd be cleaner to have it outside of the ifdefs.

Ooops, I missed it. It's above. My bad.

>> >              hr = 
>> > ID3D11VideoContext_DecoderBeginFrame(D3D11VA_CONTEXT(ctx)->video_context, 
>> > D3D11VA_CONTEXT(ctx)->decoder,
>> >                                                        get_surface(frame),
>> >                                                        0, NULL);
>> > -        }
>> >  #endif
>> >  #if CONFIG_DXVA2
>> >          if (avctx->pix_fmt == AV_PIX_FMT_DXVA2_VLD)
>> > @@ -170,21 +190,13 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, 
>> > AVFrame *frame,
>> >  #endif
>> >          if (hr != E_PENDING || ++runs > 50)
>> >              break;
>> > -#if CONFIG_D3D11VA
>> > -        if (ff_dxva2_is_d3d11(avctx))
>> > -            if (D3D11VA_CONTEXT(ctx)->context_mutex != 
>> > INVALID_HANDLE_VALUE)
>> > -                ReleaseMutex(D3D11VA_CONTEXT(ctx)->context_mutex);
>> > -#endif
>> > +        ff_dxva2_unlock(avctx);
>> >          av_usleep(2000);
>> >      } while(1);
>> >
>> >      if (FAILED(hr)) {
>> >          av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%x\n", hr);
>> > -#if CONFIG_D3D11VA
>> > -        if (ff_dxva2_is_d3d11(avctx))
>> > -            if (D3D11VA_CONTEXT(ctx)->context_mutex != 
>> > INVALID_HANDLE_VALUE)
>> > -                ReleaseMutex(D3D11VA_CONTEXT(ctx)->context_mutex);
>> > -#endif
>> > +        ff_dxva2_unlock(avctx);
>> >          return -1;
>> >      }
>> >
>> > @@ -284,16 +296,14 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, 
>> > AVFrame *frame,
>> >
>> >  end:
>> >  #if CONFIG_D3D11VA
>> > -    if (ff_dxva2_is_d3d11(avctx)) {
>> > +    if (ff_dxva2_is_d3d11(avctx))
>>
>> Same here
>
> Should be fine here too.
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to