From 957a1b49bf81dac6ac8400c5b1e5a67661bcccca Mon Sep 17 00:00:00 2001 From: Robert Stiles Date: Fri, 2 Aug 2013 14:32:23 -0500 Subject: [PATCH] Portaudio exceptions * Ignore exceptions >= 0 --- src/trx/modem.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/trx/modem.cxx b/src/trx/modem.cxx index 272b7dda..01e5343a 100644 --- a/src/trx/modem.cxx +++ b/src/trx/modem.cxx @@ -432,11 +432,13 @@ void modem::ModulateXmtr(double *buffer, int len) unsigned n = 4; while (scard->Write(buffer, len) == 0 && --n); if (n == 0) - throw SndException("Sound write failed"); + throw SndException(-99, "Sound write failed"); } catch (const SndException& e) { - LOG_ERROR("%s", e.what()); - throw; + if(e.error() < 0) { + LOG_ERROR("%s", e.what()); + throw; + } return; } @@ -458,11 +460,13 @@ void modem::ModulateStereo(double *left, double *right, int len) unsigned n = 4; while (scard->Write_stereo(left, right, len) == 0 && --n); if (n == 0) - throw SndException("Sound write failed"); + throw SndException(-99, "Sound write failed"); } catch (const SndException& e) { - LOG_ERROR("%s", e.what()); - throw; + if(e.error() < 0) { + LOG_ERROR("%s", e.what()); + throw; + } return; }