simpleaudio: improve open err msg
This commit is contained in:
parent
2a5307e698
commit
e02172087c
|
@ -394,7 +394,8 @@ main( int argc, char*argv[] )
|
||||||
if ( ! sa_out )
|
if ( ! sa_out )
|
||||||
sa_out = simpleaudio_open_stream_pulseaudio(SA_STREAM_PLAYBACK,
|
sa_out = simpleaudio_open_stream_pulseaudio(SA_STREAM_PLAYBACK,
|
||||||
program_name, "output audio");
|
program_name, "output audio");
|
||||||
assert( sa_out );
|
if ( ! sa_out )
|
||||||
|
return 1;
|
||||||
|
|
||||||
fsk_transmit_stdin(sa_out,
|
fsk_transmit_stdin(sa_out,
|
||||||
bfsk_data_rate,
|
bfsk_data_rate,
|
||||||
|
|
|
@ -100,14 +100,14 @@ simpleaudio_open_stream_pulseaudio(
|
||||||
.channels = 1,
|
.channels = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Create the recording stream */
|
/* Create the playback or recording stream */
|
||||||
pa_simple *s;
|
pa_simple *s;
|
||||||
s = pa_simple_new(NULL, app_name,
|
s = pa_simple_new(NULL, app_name,
|
||||||
sa_stream_direction == SA_STREAM_RECORD ? PA_STREAM_RECORD : PA_STREAM_PLAYBACK,
|
sa_stream_direction == SA_STREAM_RECORD ? PA_STREAM_RECORD : PA_STREAM_PLAYBACK,
|
||||||
NULL, stream_name,
|
NULL, stream_name,
|
||||||
&ss, NULL, NULL, &error);
|
&ss, NULL, NULL, &error);
|
||||||
if ( !s ) {
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue