[MPlayer-dev-eng] [PATCH 5/5] ao_alsa: some small fixes
Clemens Ladisch
clemens at ladisch.de
Mon Jan 30 09:14:53 CET 2006
Make all global variables static, remove some unused variables, and
remove the unused dir parameter from set_xxx_near() calls.
Index: MPlayer/libao2/ao_alsa.c
===================================================================
--- MPlayer.orig/libao2/ao_alsa.c 2006-01-29 19:17:14.000000000 +0100
+++ MPlayer/libao2/ao_alsa.c 2006-01-29 19:19:02.000000000 +0100
@@ -54,19 +54,16 @@ static snd_pcm_format_t alsa_format;
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 bytes_per_sample;
-int ao_mmap = 0;
-int ao_noblock = 0;
+static int ao_mmap = 0;
+static int ao_noblock = 0;
static int open_mode;
static int alsa_can_pause = 0;
@@ -257,8 +254,6 @@ static int init(int rate_hz, int channel
{
int err;
int cards = -1;
- snd_pcm_info_t *alsa_info;
- int dir = 0;
int block;
strarg_t device;
snd_pcm_uframes_t bufsize;
@@ -525,7 +520,7 @@ static int init(int rate_hz, int channel
}
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));
@@ -542,7 +537,7 @@ static int init(int rate_hz, int channel
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));
@@ -551,7 +546,7 @@ static int init(int rate_hz, int channel
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",
@@ -565,9 +560,8 @@ static int init(int rate_hz, int channel
#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));
@@ -576,7 +570,7 @@ static int init(int rate_hz, int channel
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-dev-eng
mailing list