[MPlayer-cvslog] CVS: main/libao2 ao_alsa.c,1.29,1.30

Clemens Ladisch CVS syncmail at mplayerhq.hu
Fri Feb 10 10:28:10 CET 2006


CVS change done by Clemens Ladisch CVS

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

Modified Files:
	ao_alsa.c 
Log Message:
Small fixes: make all global variables static, remove some unused
variables, and remove the unused dir parameter from set_xxx_near()
calls.

Index: ao_alsa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- ao_alsa.c	10 Feb 2006 09:26:11 -0000	1.29
+++ ao_alsa.c	10 Feb 2006 09:28:08 -0000	1.30
@@ -55,21 +55,18 @@
 static snd_pcm_hw_params_t *alsa_hwparams;
 static snd_pcm_sw_params_t *alsa_swparams;
 
-/* possible 4096, original 8192 
- * was only needed for calculating chunksize? */
-static int alsa_fragsize = 4096;
 /* 16 sets buffersize to 16 * chunksize is as default 1024
  * which seems to be good avarge for most situations 
  * so buffersize is 16384 frames by default */
 static int alsa_fragcount = 16;
-static snd_pcm_uframes_t chunk_size = 1024;//is alsa_fragsize / 4
+static snd_pcm_uframes_t chunk_size = 1024;
 
 static size_t bits_per_sample, bytes_per_sample, bits_per_frame;
 static size_t chunk_bytes;
 
-int ao_mmap = 0;
-int ao_noblock = 0;
-int first = 1;
+static int ao_mmap = 0;
+static int ao_noblock = 0;
+static int first = 1;
 
 static int open_mode;
 static int set_block_mode;
@@ -264,9 +261,7 @@
 {
     int err;
     int cards = -1;
-    snd_pcm_info_t *alsa_info;
     char *str_block_mode;
-    int dir = 0;
     int block;
     strarg_t device;
     snd_pcm_uframes_t bufsize;
@@ -551,7 +546,7 @@
 	}
 
       if ((err = snd_pcm_hw_params_set_rate_near(alsa_handler, alsa_hwparams, 
-						 &ao_data.samplerate, &dir)) < 0) 
+						 &ao_data.samplerate, NULL)) < 0) 
         {
 	  mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set samplerate-2: %s\n",
 		 snd_strerror(err));
@@ -568,7 +563,7 @@
 	int alsa_period_time;
 	alsa_period_time = alsa_buffer_time/4;
 	if ((err = snd_pcm_hw_params_set_buffer_time_near(alsa_handler, alsa_hwparams, 
-							  &alsa_buffer_time, &dir)) < 0)
+							  &alsa_buffer_time, NULL)) < 0)
 	  {
 	    mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set buffer time near: %s\n",
 		   snd_strerror(err));
@@ -577,7 +572,7 @@
 	    alsa_buffer_time = err;
 
 	if ((err = snd_pcm_hw_params_set_period_time_near(alsa_handler, alsa_hwparams, 
-							  &alsa_period_time, &dir)) < 0)
+							  &alsa_period_time, NULL)) < 0)
 	  /* original: alsa_buffer_time/ao_data.bps */
 	  {
 	    mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set period time: %s\n",
@@ -591,9 +586,8 @@
 #ifdef SET_CHUNKSIZE
       {
 	//set chunksize
-	dir=0;
 	if ((err = snd_pcm_hw_params_set_period_size_near(alsa_handler, alsa_hwparams, 
-							  &chunk_size, &dir)) < 0)
+							  &chunk_size, NULL)) < 0)
 	  {
 	    mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set periodsize(%ld): %s\n",
 			    chunk_size, snd_strerror(err));
@@ -602,7 +596,7 @@
 	  mp_msg(MSGT_AO,MSGL_V,"alsa-init: chunksize set to %li\n", chunk_size);
 	}
 	if ((err = snd_pcm_hw_params_set_periods_near(alsa_handler, alsa_hwparams,
-						      &alsa_fragcount, &dir)) < 0) {
+						      &alsa_fragcount, NULL)) < 0) {
 	  mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set periods: %s\n", 
 		 snd_strerror(err));
 	}




More information about the MPlayer-cvslog mailing list