Set playback speed

This commit is contained in:
2025-10-07 12:25:13 +09:00
parent 77024726c4
commit 1cd738e1ce
9 changed files with 189 additions and 5 deletions

View File

@@ -270,10 +270,20 @@ void NVDECAV1Decoder::Cleanup() {
// Clean up D3D12 synchronization objects
if (m_cudaSemaphore != nullptr) {
// CUDA takes ownership of the shared handle when importing the semaphore
// It will be closed automatically when destroying the semaphore
cudaDestroyExternalSemaphore(m_cudaSemaphore);
m_cudaSemaphore = nullptr;
// Ensure CUDA context is current before destroying CUDA objects
CUcontext currentCtx = nullptr;
CUresult ctxResult = cuCtxGetCurrent(&currentCtx);
if (ctxResult == CUDA_SUCCESS && currentCtx != nullptr) {
// CUDA takes ownership of the shared handle when importing the semaphore
// It will be closed automatically when destroying the semaphore
cudaDestroyExternalSemaphore(m_cudaSemaphore);
m_cudaSemaphore = nullptr;
} else {
// CUDA context not available, just null out the pointer
LOGF_WARNING("[NVDECAV1Decoder::Cleanup] CUDA context not current, skipping semaphore cleanup");
m_cudaSemaphore = nullptr;
}
}
// NOTE: m_d3d12FenceSharedHandle is owned by CUDA after import, do NOT close it here
m_d3d12FenceSharedHandle = nullptr;