aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/alsa.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-10-08 05:44:38 -0700
committerChris Robinson <[email protected]>2019-10-08 05:44:38 -0700
commit7726a06d26e59dc6a8e109af2e268de878c4f606 (patch)
tree3fdea7f120e21def8e52b89d335f63aa38372497 /alc/backends/alsa.cpp
parent360330b2add6cf10776c38aaa186b0892b54e300 (diff)
Clean up some exception messages and avoid duplicate log messages
Diffstat (limited to 'alc/backends/alsa.cpp')
-rw-r--r--alc/backends/alsa.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/alc/backends/alsa.cpp b/alc/backends/alsa.cpp
index a9eb6d5f..7c6ce4f9 100644
--- a/alc/backends/alsa.cpp
+++ b/alc/backends/alsa.cpp
@@ -616,11 +616,8 @@ void AlsaPlayback::open(const ALCchar *name)
TRACE("Opening device \"%s\"\n", driver);
int err{snd_pcm_open(&mPcmHandle, driver, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK)};
if(err < 0)
- {
- ERR("Could not open playback device '%s': %s\n", driver, snd_strerror(err));
- throw al::backend_exception{ALC_OUT_OF_MEMORY, "Could not open ALSA playback \"%s\"",
+ throw al::backend_exception{ALC_OUT_OF_MEMORY, "Could not open ALSA device \"%s\"",
driver};
- }
/* Free alsa's global config tree. Otherwise valgrind reports a ton of leaks. */
snd_config_update_free_global();
@@ -917,11 +914,8 @@ void AlsaCapture::open(const ALCchar *name)
TRACE("Opening device \"%s\"\n", driver);
int err{snd_pcm_open(&mPcmHandle, driver, SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)};
if(err < 0)
- {
- ERR("Could not open capture device '%s': %s\n", driver, snd_strerror(err));
- throw al::backend_exception{ALC_OUT_OF_MEMORY, "Could not open ALSA capture \"%s\"",
+ throw al::backend_exception{ALC_OUT_OF_MEMORY, "Could not open ALSA device \"%s\"",
driver};
- }
/* Free alsa's global config tree. Otherwise valgrind reports a ton of leaks. */
snd_config_update_free_global();
@@ -989,11 +983,7 @@ void AlsaCapture::open(const ALCchar *name)
if(needring)
{
mRing = CreateRingBuffer(mDevice->BufferSize, mDevice->frameSizeFromFmt(), false);
- if(!mRing)
- {
- ERR("ring buffer create failed\n");
- throw al::backend_exception{ALC_INVALID_VALUE, "Failed to create ring buffer"};
- }
+ if(!mRing) throw al::backend_exception{ALC_INVALID_VALUE, "Failed to create ring buffer"};
}
mDevice->DeviceName = name;