From 4f1e93206355e5617850a1f375ed2c57db7245c4 Mon Sep 17 00:00:00 2001 From: CeSium Date: Tue, 18 Nov 2025 21:41:38 +0200 Subject: [PATCH 1/2] refactor: simplify exception handling in RtAudioOutput methods --- openauto/Projection/RtAudioOutput.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openauto/Projection/RtAudioOutput.cpp b/openauto/Projection/RtAudioOutput.cpp index 68ae27e14..90e5b8587 100644 --- a/openauto/Projection/RtAudioOutput.cpp +++ b/openauto/Projection/RtAudioOutput.cpp @@ -55,9 +55,9 @@ bool RtAudioOutput::open() dac_->openStream(¶meters, nullptr, RTAUDIO_SINT16, sampleRate_, &bufferFrames, &RtAudioOutput::audioBufferReadHandler, static_cast(this), &streamOptions); return audioBuffer_.open(QIODevice::ReadWrite); } - catch(const RtAudioError& e) + catch { - OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to open audio output, what: " << e.what(); + OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to open audio output, what: " << "err"; } } else @@ -83,9 +83,9 @@ void RtAudioOutput::start() { dac_->startStream(); } - catch(const RtAudioError& e) + catch { - OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to start audio output, what: " << e.what(); + OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to start audio output, what: " << "error"; } } } @@ -130,9 +130,9 @@ void RtAudioOutput::doSuspend() { dac_->stopStream(); } - catch(const RtAudioError& e) + catch { - OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to suspend audio output, what: " << e.what(); + OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to suspend audio output, what: " << "error"; } } } From cf82d5b0062c1162a8c67e29c6b31527aa4ed5c9 Mon Sep 17 00:00:00 2001 From: CeSium Date: Tue, 18 Nov 2025 21:47:07 +0200 Subject: [PATCH 2/2] refactor: improve exception handling in RtAudioOutput methods --- openauto/Projection/RtAudioOutput.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openauto/Projection/RtAudioOutput.cpp b/openauto/Projection/RtAudioOutput.cpp index 90e5b8587..cb91c0281 100644 --- a/openauto/Projection/RtAudioOutput.cpp +++ b/openauto/Projection/RtAudioOutput.cpp @@ -55,7 +55,7 @@ bool RtAudioOutput::open() dac_->openStream(¶meters, nullptr, RTAUDIO_SINT16, sampleRate_, &bufferFrames, &RtAudioOutput::audioBufferReadHandler, static_cast(this), &streamOptions); return audioBuffer_.open(QIODevice::ReadWrite); } - catch + catch(...) { OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to open audio output, what: " << "err"; } @@ -83,7 +83,7 @@ void RtAudioOutput::start() { dac_->startStream(); } - catch + catch(...) { OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to start audio output, what: " << "error"; } @@ -130,7 +130,7 @@ void RtAudioOutput::doSuspend() { dac_->stopStream(); } - catch + catch(...) { OPENAUTO_LOG(error) << "[RtAudioOutput] Failed to suspend audio output, what: " << "error"; }