aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/oboe.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-03-08 22:29:40 -0800
committerChris Robinson <[email protected]>2021-03-08 22:29:40 -0800
commit730c964029f7b649510490d8766aba801f576492 (patch)
treef9415b25e80d49ac40a02d6f94a96cfa355ca8b0 /alc/backends/oboe.cpp
parent0f7ed495e199f7158295c6a61ea0e0080a5b4339 (diff)
Allow calling BackendBase::open multiple times on playback devices
It will not be called while the device is running. If the first call succeeds, a subsequent call that happens to fail must leave the existing device state as it was so it can be resumed. This is a rough first pass. It will fail when trying to re-open the same device which can only be opened once (for instance, with direct hardware access, on hardware that doesn't do its own mixing). Some backends won't guarantee the new device is usable until the reset() or start() call.
Diffstat (limited to 'alc/backends/oboe.cpp')
-rw-r--r--alc/backends/oboe.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/alc/backends/oboe.cpp b/alc/backends/oboe.cpp
index d84cea8e..b94a0882 100644
--- a/alc/backends/oboe.cpp
+++ b/alc/backends/oboe.cpp
@@ -64,9 +64,10 @@ void OboePlayback::open(const char *name)
name};
/* Open a basic output stream, just to ensure it can work. */
+ oboe::ManagedStream stream;
oboe::Result result{oboe::AudioStreamBuilder{}.setDirection(oboe::Direction::Output)
->setPerformanceMode(oboe::PerformanceMode::LowLatency)
- ->openManagedStream(mStream)};
+ ->openManagedStream(stream)};
if(result != oboe::Result::OK)
throw al::backend_exception{al::backend_error::DeviceError, "Failed to create stream: %s",
oboe::convertToText(result)};