In dxva2 code there is bug with context_mutex usage -
if ID3D11VideoContext_DecoderBeginFrame return E_PENDING -
WaitForSingleObjectEx(context_mutex) will be called again, but each call to
it must have corresponding ReleaseMutex, otherwise it will not be released
- so after E_PENDING context mutex will never be released.
--- dxva2.c
+++ dxva2fix.c
@@ -142,11 +142,16 @@
     HRESULT hr;
     unsigned type;
 
-    do {
 #if CONFIG_D3D11VA
-        if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) {
+       if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) {
             if (D3D11VA_CONTEXT(ctx)->context_mutex != INVALID_HANDLE_VALUE)
                 WaitForSingleObjectEx(D3D11VA_CONTEXT(ctx)->context_mutex, 
INFINITE, FALSE);
+       }
+#endif
+       
+    do {
+#if CONFIG_D3D11VA
+        if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) {
             hr = 
ID3D11VideoContext_DecoderBeginFrame(D3D11VA_CONTEXT(ctx)->video_context, 
D3D11VA_CONTEXT(ctx)->decoder,
                                                       
ff_dxva2_get_surface(frame),
                                                       0, NULL);
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to