Source: soapyaudio
Followup-For: Bug #1051556
Control: tags -1 patch

Please find the attached quilt patch that fixes the problem.
(No debdiff for now, sorry)
Description: Fix FTBFS with RtAudio 6
 Replace Exceptions with error-codes
Author: IOhannes m zmölnig
Origin: Debian
Forwarded: no
Last-Update: 2023-09-09
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: soapyaudio-0.1.1/Streaming.cpp
===================================================================
--- soapyaudio-0.1.1.orig/Streaming.cpp
+++ soapyaudio-0.1.1/Streaming.cpp
@@ -223,11 +223,11 @@ int SoapyAudio::activateStream(
         const long long timeNs,
         const size_t numElems)
 {
+    RtAudioErrorType err;
     if (flags != 0) return SOAPY_SDR_NOT_SUPPORTED;
     resetBuffer = true;
     bufferedElems = 0;
 
-    try {
 #ifndef _MSC_VER
         opts.priority = sched_get_priority_max(SCHED_FIFO);
 #endif
@@ -235,13 +235,14 @@ int SoapyAudio::activateStream(
         opts.flags = RTAUDIO_SCHEDULE_REALTIME;
 
         sampleRateChanged.store(false);
-        dac.openStream(NULL, &inputParameters, RTAUDIO_FLOAT32, sampleRate, 
&bufferLength, &_rx_callback, (void *) this, &opts);
-        dac.startStream();
+        err = dac.openStream(NULL, &inputParameters, RTAUDIO_FLOAT32, 
sampleRate, &bufferLength, &_rx_callback, (void *) this, &opts);
+       if (RTAUDIO_NO_ERROR == err)
+            err = dac.startStream();
+       if (RTAUDIO_NO_ERROR != err) {
+               throw std::runtime_error("RtAudio init error '" + 
dac.getErrorText() + "'");
+       }
 
         streamActive = true;
-    } catch (RtAudioError& e) {
-        throw std::runtime_error("RtAudio init error '" + e.getMessage());
-    }
     
     return 0;
 }

Reply via email to