diff options
author | Chris Robinson <[email protected]> | 2019-10-08 21:52:08 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-10-08 21:55:03 -0700 |
commit | 963580c2d503eab7c6d8f60a367498ff103bfa3e (patch) | |
tree | ca30803987383fd8bbf413ee7fdd33898c97f2da /alc/backends/jack.cpp | |
parent | 7726a06d26e59dc6a8e109af2e268de878c4f606 (diff) |
Never return null from CreateRingBuffer
Allocation failure would already throw a bad_alloc anyway, now a size overflow
throws an exception too.
Diffstat (limited to 'alc/backends/jack.cpp')
-rw-r--r-- | alc/backends/jack.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp index 2a22ed84..0814ca8d 100644 --- a/alc/backends/jack.cpp +++ b/alc/backends/jack.cpp @@ -212,11 +212,7 @@ int JackPlayback::bufferSizeNotify(jack_nframes_t numframes) mRing = nullptr; mRing = CreateRingBuffer(bufsize, mDevice->frameSizeFromFmt(), true); - if(!mRing) - { - ERR("Failed to reallocate ringbuffer\n"); - aluHandleDisconnect(mDevice, "Failed to reallocate %u-sample buffer", bufsize); - } + return 0; } @@ -407,11 +403,6 @@ bool JackPlayback::reset() mRing = nullptr; mRing = CreateRingBuffer(bufsize, mDevice->frameSizeFromFmt(), true); - if(!mRing) - { - ERR("Failed to allocate ringbuffer\n"); - return false; - } SetDefaultChannelOrder(mDevice); |