File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
src/Cafe/OS/libs/snd_core Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -401,26 +401,22 @@ namespace snd_core
401
401
if (vpb != nullptr )
402
402
{
403
403
AXVoiceList_AddVoice (vpb, priority);
404
- vpb->userParam = userParam;
405
- vpb->callback = MPTR_NULL;
406
- vpb->callbackEx = callbackEx;
407
- AXVPB_SetVoiceDefault (vpb);
408
404
}
409
405
else
410
406
{
411
- // no free voice available, drop voice with lower priority
412
- AXVPB* droppedVoice = AXVPB_DropVoice (priority);
413
- if (droppedVoice == nullptr )
407
+ // no free voice available, try to drop a voice with lower priority
408
+ vpb = AXVPB_DropVoice (priority);
409
+ if (!vpb )
414
410
{
415
411
// no voice available
416
412
__AXVoiceListSpinlock.unlock ();
417
413
return nullptr ;
418
414
}
419
- vpb->userParam = userParam;
420
- vpb->callback = MPTR_NULL;
421
- vpb->callbackEx = callbackEx;
422
- AXVPB_SetVoiceDefault (vpb);
423
415
}
416
+ vpb->userParam = userParam;
417
+ vpb->callback = MPTR_NULL;
418
+ vpb->callbackEx = callbackEx;
419
+ AXVPB_SetVoiceDefault (vpb);
424
420
__AXVoiceListSpinlock.unlock ();
425
421
return vpb;
426
422
}
You can’t perform that action at this time.
0 commit comments