From 76e7d25f41354014ecf56f5a3329c7d3de82e083 Mon Sep 17 00:00:00 2001 From: Lars Bisballe Jensen Date: Sun, 28 Sep 2014 21:03:06 +0200 Subject: Added a bit of error checking --- src/audiobackend-pulse.cc | 11 ++++++++--- 1 file 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() -- cgit v1.2.3