diff options
author | Lars Bisballe Jensen <larsbisballe@gmail.com> | 2014-09-28 21:03:06 +0200 |
---|---|---|
committer | Lars Bisballe Jensen <larsbisballe@gmail.com> | 2014-09-28 21:03:06 +0200 |
commit | 76e7d25f41354014ecf56f5a3329c7d3de82e083 (patch) | |
tree | 652c2192cb22753d4a33d38639779f81ce757dc9 | |
parent | 7d59d990fbf5df023acef01cb092fac143be2345 (diff) |
Added a bit of error checking
-rw-r--r-- | src/audiobackend-pulse.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/audiobackend-pulse.cc b/src/audiobackend-pulse.cc index 83fc93d..2eadedf 100644 --- a/src/audiobackend-pulse.cc +++ b/src/audiobackend-pulse.cc @@ -26,6 +26,7 @@ */ #include "audiobackend-pulse.h" #include "mediaconfig.h" +#include "stdio.h" #ifdef WITH_PULSE @@ -50,6 +51,8 @@ AudioBackendPulse::AudioBackendPulse(const char *device) ss.channels = 1; ss.rate = SAMPLERATE; + int error; + sIn = pa_simple_new(NULL, // Use the default server. "SimpleRTP", // Our application's name. PA_STREAM_RECORD, @@ -58,9 +61,10 @@ AudioBackendPulse::AudioBackendPulse(const char *device) &ss, // Our sample format. NULL, // Use default channel map NULL, // Use default buffering attributes. - NULL // Ignore error code. + &error // Ignore error code. ); - + printf("Pulse in: %s\n", pa_strerror(error)); + sOut = pa_simple_new(NULL, // Use the default server. "SimpleRTP", // Our application's name. PA_STREAM_PLAYBACK, @@ -69,8 +73,9 @@ AudioBackendPulse::AudioBackendPulse(const char *device) &ss, // Our sample format. NULL, // Use default channel map NULL, // Use default buffering attributes. - NULL // Ignore error code. + &error // Ignore error code. ); + printf("Pulse out: %s\n", pa_strerror(error)); } AudioBackendPulse::~AudioBackendPulse() |