changeset 16308:41278ab73e9b

set the nearest number of channels, return(0) upon errors
author henry
date Thu, 25 Aug 2005 19:57:32 +0000
parents 03cd6abe5664
children aa7829aa8428
files libao2/ao_alsa.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_alsa.c	Thu Aug 25 19:46:20 2005 +0000
+++ b/libao2/ao_alsa.c	Thu Aug 25 19:57:32 2005 +0000
@@ -548,13 +548,15 @@
 	{
 	  mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set format: %s\n",
 		 snd_strerror(err));
+	  return(0);
 	}
 
-      if ((err = snd_pcm_hw_params_set_channels(alsa_handler, alsa_hwparams,
-						ao_data.channels)) < 0)
+      if ((err = snd_pcm_hw_params_set_channels_near(alsa_handler, alsa_hwparams,
+						     &ao_data.channels)) < 0)
 	{
 	  mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set channels: %s\n",
 		 snd_strerror(err));
+	  return(0);
 	}
 
       if ((err = snd_pcm_hw_params_set_rate_near(alsa_handler, alsa_hwparams,