Mercurial > mplayer.hg
comparison libao2/ao_alsa.c @ 30398:acb92f578a08
Do not needlessly use (file-)global variables.
Since they also were initialized to a value and non-constant (changed
by ALSA) this might actually have caused bugs.
author | reimar |
---|---|
date | Wed, 27 Jan 2010 18:10:07 +0000 |
parents | 02b9c1a452e1 |
children | d280f1bbfe93 |
comparison
equal
deleted
inserted
replaced
30397:3e858991e23d | 30398:acb92f578a08 |
---|---|
70 static snd_pcm_t *alsa_handler; | 70 static snd_pcm_t *alsa_handler; |
71 static snd_pcm_format_t alsa_format; | 71 static snd_pcm_format_t alsa_format; |
72 static snd_pcm_hw_params_t *alsa_hwparams; | 72 static snd_pcm_hw_params_t *alsa_hwparams; |
73 static snd_pcm_sw_params_t *alsa_swparams; | 73 static snd_pcm_sw_params_t *alsa_swparams; |
74 | 74 |
75 static unsigned int alsa_buffer_time = 500000; /* 0.5 s */ | |
76 static unsigned int alsa_fragcount = 16; | |
77 | |
78 static size_t bytes_per_sample; | 75 static size_t bytes_per_sample; |
79 | 76 |
80 static int ao_noblock = 0; | 77 static int ao_noblock = 0; |
81 | 78 |
82 static int open_mode; | |
83 static int alsa_can_pause = 0; | 79 static int alsa_can_pause = 0; |
84 | 80 |
85 #define ALSA_DEVICE_SIZE 256 | 81 #define ALSA_DEVICE_SIZE 256 |
86 | 82 |
87 static void alsa_error_handler(const char *file, int line, const char *function, | 83 static void alsa_error_handler(const char *file, int line, const char *function, |
317 open & setup audio device | 313 open & setup audio device |
318 return: 1=success 0=fail | 314 return: 1=success 0=fail |
319 */ | 315 */ |
320 static int init(int rate_hz, int channels, int format, int flags) | 316 static int init(int rate_hz, int channels, int format, int flags) |
321 { | 317 { |
318 unsigned int alsa_buffer_time = 500000; /* 0.5 s */ | |
319 unsigned int alsa_fragcount = 16; | |
320 int open_mode; | |
322 int err; | 321 int err; |
323 int block; | 322 int block; |
324 strarg_t device; | 323 strarg_t device; |
325 snd_pcm_uframes_t chunk_size; | 324 snd_pcm_uframes_t chunk_size; |
326 snd_pcm_uframes_t bufsize; | 325 snd_pcm_uframes_t bufsize; |