From 963580c2d503eab7c6d8f60a367498ff103bfa3e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 8 Oct 2019 21:52:08 -0700 Subject: Never return null from CreateRingBuffer Allocation failure would already throw a bad_alloc anyway, now a size overflow throws an exception too. --- alc/backends/jack.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'alc/backends/jack.cpp') 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); -- cgit v1.2.3