simpleaudio: improve open err msg

This commit is contained in:
Kamal Mostafa 2011-07-03 08:59:15 -07:00
parent 2a5307e698
commit e02172087c
2 changed files with 4 additions and 3 deletions

View File

@ -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,

View File

@ -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;
}