mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 13:10:37 +00:00
d3d11va: don't keep the context lock while waiting for a frame
also fixes a deadlock found by Денис Кулаков <kudesnik33ra@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
8b069b1cd5
commit
193a421994
@ -158,9 +158,15 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
ff_dxva2_get_surface(frame),
|
||||
NULL);
|
||||
#endif
|
||||
if (hr == E_PENDING)
|
||||
av_usleep(2000);
|
||||
} while (hr == E_PENDING && ++runs < 50);
|
||||
if (hr != E_PENDING || ++runs > 50)
|
||||
break;
|
||||
#if CONFIG_D3D11VA
|
||||
if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD)
|
||||
if (D3D11VA_CONTEXT(ctx)->context_mutex != INVALID_HANDLE_VALUE)
|
||||
ReleaseMutex(D3D11VA_CONTEXT(ctx)->context_mutex);
|
||||
#endif
|
||||
av_usleep(2000);
|
||||
} while(1);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%lx\n", hr);
|
||||
|
Loading…
Reference in New Issue
Block a user