| 724 | } |
| 725 | |
| 726 | void FreeSource(ALCcontext *context, ALsource *source) |
| 727 | { |
| 728 | const ALuint id{source->id - 1}; |
| 729 | const size_t lidx{id >> 6}; |
| 730 | const ALuint slidx{id & 0x3f}; |
| 731 | |
| 732 | if(IsPlayingOrPaused(source)) |
| 733 | { |
| 734 | if(Voice *voice{GetSourceVoice(source, context)}) |
| 735 | { |
| 736 | VoiceChange *vchg{GetVoiceChanger(context)}; |
| 737 | |
| 738 | voice->mPendingChange.store(true, std::memory_order_relaxed); |
| 739 | vchg->mVoice = voice; |
| 740 | vchg->mSourceID = source->id; |
| 741 | vchg->mState = VChangeState::Stop; |
| 742 | |
| 743 | SendVoiceChanges(context, vchg); |
| 744 | } |
| 745 | } |
| 746 | |
| 747 | al::destroy_at(source); |
| 748 | |
| 749 | context->mSourceList[lidx].FreeMask |= 1_u64 << slidx; |
| 750 | context->mNumSources--; |
| 751 | } |
| 752 | |
| 753 | |
| 754 | inline ALsource *LookupSource(ALCcontext *context, ALuint id) noexcept |
no test coverage detected