src/audio/alsa/SDL_alsa_audio.c
branchSDL-1.2
changeset 4365 d91a8026e0aa
parent 4364 ae3d564e2716
child 4402 ed7b8e3520b5
equal deleted inserted replaced
4364:ae3d564e2716 4365:d91a8026e0aa
   379 	/* FIXME: Is this safe to do? */
   379 	/* FIXME: Is this safe to do? */
   380 	spec->samples = bufsize / 2;
   380 	spec->samples = bufsize / 2;
   381 
   381 
   382 	/* This is useful for debugging */
   382 	/* This is useful for debugging */
   383 	if ( getenv("SDL_AUDIO_ALSA_DEBUG") ) {
   383 	if ( getenv("SDL_AUDIO_ALSA_DEBUG") ) {
   384 		snd_pcm_sframes_t persize = 0;
   384 		snd_pcm_uframes_t persize = 0;
   385 		unsigned int periods = 0;
   385 		unsigned int periods = 0;
   386 
   386 
   387 		SDL_NAME(snd_pcm_hw_params_get_period_size)(hwparams, &persize, NULL);
   387 		SDL_NAME(snd_pcm_hw_params_get_period_size)(hwparams, &persize, NULL);
   388 		SDL_NAME(snd_pcm_hw_params_get_periods)(hwparams, &periods, NULL);
   388 		SDL_NAME(snd_pcm_hw_params_get_periods)(hwparams, &periods, NULL);
   389 
   389 
   465 	snd_pcm_hw_params_t *hwparams;
   465 	snd_pcm_hw_params_t *hwparams;
   466 	snd_pcm_sw_params_t *swparams;
   466 	snd_pcm_sw_params_t *swparams;
   467 	snd_pcm_format_t     format;
   467 	snd_pcm_format_t     format;
   468 	unsigned int         rate;
   468 	unsigned int         rate;
   469 	unsigned int 	     channels;
   469 	unsigned int 	     channels;
   470 	snd_pcm_uframes_t    bufsize;
       
   471 	Uint16               test_format;
   470 	Uint16               test_format;
   472 
   471 
   473 	/* Open the audio device */
   472 	/* Open the audio device */
   474 	/* Name of device should depend on # channels in spec */
   473 	/* Name of device should depend on # channels in spec */
   475 	status = SDL_NAME(snd_pcm_open)(&pcm_handle, get_audio_device(spec->channels), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
   474 	status = SDL_NAME(snd_pcm_open)(&pcm_handle, get_audio_device(spec->channels), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);