From 6394b96e6f47840868d0cebe17c486a09fc9a651 Mon Sep 17 00:00:00 2001 From: sletz Date: Wed, 30 Apr 2008 20:30:58 +0000 Subject: [PATCH] Simplify drivers exceptions git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2220 0c269be4-1314-0410-8aa9-9f06e86f4224 --- common/JackAudioDriver.cpp | 7 +------ common/JackThreadedDriver.cpp | 14 +++----------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/common/JackAudioDriver.cpp b/common/JackAudioDriver.cpp index 2a6f688d..adc28dd4 100644 --- a/common/JackAudioDriver.cpp +++ b/common/JackAudioDriver.cpp @@ -176,12 +176,7 @@ int JackAudioDriver::Write() int JackAudioDriver::Process() { - try { - return (fEngineControl->fSyncMode) ? ProcessSync() : ProcessAsync(); - } catch (JackException e) { - e.PrintMessage(); - return -1; - } + return (fEngineControl->fSyncMode) ? ProcessSync() : ProcessAsync(); } /* diff --git a/common/JackThreadedDriver.cpp b/common/JackThreadedDriver.cpp index d3d31ea5..68373935 100644 --- a/common/JackThreadedDriver.cpp +++ b/common/JackThreadedDriver.cpp @@ -105,15 +105,7 @@ int JackThreadedDriver::Stop() bool JackThreadedDriver::Execute() { - try { - // Keep running even in case of error - Process(); - return true; - } catch (JackException e) { - e.PrintMessage(); - jack_error("Driver is stopped"); - return false; - } + return (Process() == 0); } bool JackThreadedDriver::Init() @@ -129,9 +121,9 @@ bool JackRestartThreadedDriver::Execute() while (fThread->GetStatus() == JackThread::kRunning) { Process(); } - } catch (JackException e) { + } catch (JackDriverException e) { e.PrintMessage(); - jack_log("Driver is restarted..."); + jack_log("Driver is restarted"); Init(); } }