diff options
| author | Keith Packard <keithp@keithp.com> | 2009-10-06 20:06:00 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-10-06 20:06:00 -0700 | 
| commit | a3771bfc5ce740f9d89193e9f8b1d7987aa57264 (patch) | |
| tree | 5a032a81b829dce75e2523ecf7930e166ebca460 | |
| parent | ac4b8a73848f434999a532eab4665253c267c597 (diff) | |
ao-view: fix snd_pcm_open return checking
I don't know how this code was supposed to work before...
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | ao-tools/ao-view/aoview_flite.c | 10 | 
1 files changed, 4 insertions, 6 deletions
diff --git a/ao-tools/ao-view/aoview_flite.c b/ao-tools/ao-view/aoview_flite.c index e1b75898..bc702b0f 100644 --- a/ao-tools/ao-view/aoview_flite.c +++ b/ao-tools/ao-view/aoview_flite.c @@ -42,12 +42,10 @@ aoview_flite_task(gpointer data)  	err = snd_pcm_open(&alsa_handle, "default",  			   SND_PCM_STREAM_PLAYBACK, 0); -	if (err >= 0) -	{ -		if (err < 0) { -			snd_pcm_close(alsa_handle); -			alsa_handle = 0; -		} +	if (err < 0) { +		fprintf(stderr, "alsa open failed %s\n", +			strerror(-err)); +		alsa_handle = NULL;  	}  	rate = 0;  	channels = 0;  | 
