From e02172087c0171ca8c7dae441be5bc9059bac2e0 Mon Sep 17 00:00:00 2001 From: Kamal Mostafa Date: Sun, 3 Jul 2011 08:59:15 -0700 Subject: [PATCH] simpleaudio: improve open err msg --- src/minimodem.c | 3 ++- src/simpleaudio-pulse.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/minimodem.c b/src/minimodem.c index d254df2..34f831b 100644 --- a/src/minimodem.c +++ b/src/minimodem.c @@ -394,7 +394,8 @@ main( int argc, char*argv[] ) if ( ! sa_out ) sa_out = simpleaudio_open_stream_pulseaudio(SA_STREAM_PLAYBACK, program_name, "output audio"); - assert( sa_out ); + if ( ! sa_out ) + return 1; fsk_transmit_stdin(sa_out, bfsk_data_rate, diff --git a/src/simpleaudio-pulse.c b/src/simpleaudio-pulse.c index de0ed66..4a3aa2b 100644 --- a/src/simpleaudio-pulse.c +++ b/src/simpleaudio-pulse.c @@ -100,14 +100,14 @@ simpleaudio_open_stream_pulseaudio( .channels = 1, }; - /* Create the recording stream */ + /* Create the playback or recording stream */ pa_simple *s; s = pa_simple_new(NULL, app_name, sa_stream_direction == SA_STREAM_RECORD ? PA_STREAM_RECORD : PA_STREAM_PLAYBACK, NULL, stream_name, &ss, NULL, NULL, &error); if ( !s ) { - fprintf(stderr, "pa_simple_new: %s\n", pa_strerror(error)); + fprintf(stderr, "E: Cannot create PulseAudio stream: %s\n ", pa_strerror(error)); return NULL; }