fix(audio): keep unavailable world slots quiescent
Construct the retail-sized world voice ledger independently of OpenAL device availability so world reveal suspension is a safe no-op on machines without an audio backend. Co-authored-by: Erik Nilsson <erikn@users.noreply.github.com>
This commit is contained in:
parent
3f1548b952
commit
a77ba06722
2 changed files with 25 additions and 2 deletions
|
|
@ -89,6 +89,21 @@ public sealed class OpenAlResourceLifetimeTests
|
|||
Assert.Equal(1, api.CloseDeviceCalls);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnavailableEngineWorldQuiescenceRemainsASafeNoOp()
|
||||
{
|
||||
var api = new RecordingApi { ContextResult = 0 };
|
||||
var engine = new OpenAlAudioEngine(new Factory(api));
|
||||
|
||||
engine.SuspendWorldAudio();
|
||||
engine.StopAllForOwner(0x50000001u);
|
||||
engine.ResumeWorldAudio();
|
||||
|
||||
Assert.False(engine.IsAvailable);
|
||||
Assert.True(engine.IsDisposalComplete);
|
||||
Assert.Empty(api.GeneratedSources);
|
||||
}
|
||||
|
||||
private sealed class Factory(IOpenAlResourceApi api) : IOpenAlResourceApiFactory
|
||||
{
|
||||
public IOpenAlResourceApi Create() => api;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue