| 421 | } |
| 422 | |
| 423 | void VideoBackendPlayer::ReleaseResources() |
| 424 | { |
| 425 | if (AudioSource) |
| 426 | { |
| 427 | AudioBackend::Source::Stop(AudioSource); |
| 428 | AudioBackend::Source::Remove(AudioSource); |
| 429 | AudioSource = 0; |
| 430 | } |
| 431 | for (uint32& bufferId : AudioBuffers) |
| 432 | { |
| 433 | if (bufferId) |
| 434 | { |
| 435 | AudioBackend::Buffer::Delete(bufferId); |
| 436 | bufferId = 0; |
| 437 | } |
| 438 | } |
| 439 | if (UploadVideoFrameTask) |
| 440 | UploadVideoFrameTask->Cancel(); |
| 441 | VideoFrameMemory.Release(); |
| 442 | SAFE_DELETE_GPU_RESOURCE(Frame); |
| 443 | SAFE_DELETE_GPU_RESOURCE(FrameUpload); |
| 444 | #ifdef TRACY_ENABLE |
| 445 | Allocator::Free(DebugUrl); |
| 446 | #endif |
| 447 | } |