[MPlayer-cvslog] CVS: main/libao2 ao_alsa.c,1.40,1.41

Clemens Ladisch CVS syncmail at mplayerhq.hu
Fri Mar 31 11:28:40 CEST 2006


CVS change done by Clemens Ladisch CVS

Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv21389

Modified Files:
	ao_alsa.c 
Log Message:
Add workarounds for old prerelease versions of alsa-lib 0.9.0 that did
not allow reading the buffer boundary value.

Index: ao_alsa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- ao_alsa.c	13 Mar 2006 10:50:37 -0000	1.40
+++ ao_alsa.c	31 Mar 2006 09:28:37 -0000	1.41
@@ -638,11 +638,15 @@
 	       snd_strerror(err));
 	return 0;
       }
+#if SND_LIB_VERSION >= 0x000901
       if ((err = snd_pcm_sw_params_get_boundary(alsa_swparams, &boundary)) < 0) {
 	mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to get boundary: %s\n",
 	       snd_strerror(err));
 	return 0;
       }
+#else
+      boundary = 0x7fffffff;
+#endif
       /* start playing when one period has been written */
       if ((err = snd_pcm_sw_params_set_start_threshold(alsa_handler, alsa_swparams, chunk_size)) < 0) {
 	mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set start threshold: %s\n",
@@ -655,12 +659,14 @@
 	       snd_strerror(err));
 	return 0;
       }
+#if SND_LIB_VERSION >= 0x000901
       /* play silence when there is an underrun */
       if ((err = snd_pcm_sw_params_set_silence_size(alsa_handler, alsa_swparams, boundary)) < 0) {
 	mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set silence size: %s\n",
 	       snd_strerror(err));
 	return 0;
       }
+#endif
       if ((err = snd_pcm_sw_params(alsa_handler, alsa_swparams)) < 0) {
 	mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set sw-parameters: %s\n",
 	       snd_strerror(err));




More information about the MPlayer-cvslog mailing list