aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/coreaudio.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-04-28 19:25:58 -0700
committerChris Robinson <[email protected]>2020-04-28 19:25:58 -0700
commit4094135ed7e7d1f2c22cf944094f7f0daf2cd8e6 (patch)
tree4ab7df9fb3afb2554fbe4c48e522263fb7e2d670 /alc/backends/coreaudio.cpp
parent065775d814a972bfedf2cc8e5db35a56f1eecb93 (diff)
Don't return a bool from the backend start method
Diffstat (limited to 'alc/backends/coreaudio.cpp')
-rw-r--r--alc/backends/coreaudio.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp
index df889439..12a8cec4 100644
--- a/alc/backends/coreaudio.cpp
+++ b/alc/backends/coreaudio.cpp
@@ -61,7 +61,7 @@ struct CoreAudioPlayback final : public BackendBase {
void open(const ALCchar *name) override;
bool reset() override;
- bool start() override;
+ void start() override;
void stop() override;
AudioUnit mAudioUnit{};
@@ -269,15 +269,11 @@ bool CoreAudioPlayback::reset()
return true;
}
-bool CoreAudioPlayback::start()
+void CoreAudioPlayback::start()
{
- OSStatus err{AudioOutputUnitStart(mAudioUnit)};
+ const OSStatus err{AudioOutputUnitStart(mAudioUnit)};
if(err != noErr)
- {
- ERR("AudioOutputUnitStart failed\n");
- return false;
- }
- return true;
+ throw al::backend_exception{ALC_INVALID_DEVICE, "AudioOutputUnitStart failed: %d", err};
}
void CoreAudioPlayback::stop()
@@ -304,7 +300,7 @@ struct CoreAudioCapture final : public BackendBase {
}
void open(const ALCchar *name) override;
- bool start() override;
+ void start() override;
void stop() override;
ALCenum captureSamples(al::byte *buffer, ALCuint samples) override;
ALCuint availableSamples() override;
@@ -576,15 +572,11 @@ void CoreAudioCapture::open(const ALCchar *name)
}
-bool CoreAudioCapture::start()
+void CoreAudioCapture::start()
{
OSStatus err{AudioOutputUnitStart(mAudioUnit)};
if(err != noErr)
- {
- ERR("AudioOutputUnitStart failed\n");
- return false;
- }
- return true;
+ throw al::backend_exception{ALC_INVALID_DEVICE, "AudioOutputUnitStart failed: %d", err};
}
void CoreAudioCapture::stop()