Set playback speed
This commit is contained in:
@@ -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(¤tCtx);
|
||||
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user