Lines Matching refs:this

112     this->hidden = (struct SDL_PrivateAudioData *) SDL_malloc(sizeof(*this->hidden));  in AOS_OpenDevice()
113 if (this->hidden == NULL) { in AOS_OpenDevice()
116 SDL_zerop(this->hidden); in AOS_OpenDevice()
123 this->hidden->pcm_handle = pcm_handle; in AOS_OpenDevice()
127 for (test_format = SDL_FirstAudioFormat(this->spec.format); test_format && (status < 0);) { in AOS_OpenDevice()
151 this->spec.format = test_format; in AOS_OpenDevice()
155 channels = this->spec.channels; in AOS_OpenDevice()
158 rate = this->spec.freq; in AOS_OpenDevice()
161 SDL_CalculateAudioSpec(&this->spec); in AOS_OpenDevice()
165 this->hidden->mixlen = this->spec.size; in AOS_OpenDevice()
166 this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); in AOS_OpenDevice()
167 if (this->hidden->mixbuf == NULL) { in AOS_OpenDevice()
170 SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen); in AOS_OpenDevice()
173 snd_pcm_set_params(this->hidden->pcm_handle, in AOS_OpenDevice()
180 snd_pcm_prepare(this->hidden->pcm_handle); in AOS_OpenDevice()
195 return (this->hidden->mixbuf); in AOS_GetDeviceBuf()
201 const Uint8 *sample_buf = (const Uint8 *) this->hidden->mixbuf; in ALSA_PlayDevice()
202 const int frame_size = ((SDL_AUDIO_BITSIZE(this->spec.format)) / 8) * this->spec.channels; in ALSA_PlayDevice()
203 snd_pcm_uframes_t frames_left = ((snd_pcm_uframes_t) this->spec.samples); in ALSA_PlayDevice()
205 if(this->hidden->swizzle_func) in ALSA_PlayDevice()
206 this->hidden->swizzle_func(this, this->hidden->mixbuf, frames_left); in ALSA_PlayDevice()
210 snd_pcm_start(this->hidden->pcm_handle); in ALSA_PlayDevice()
212 while ( frames_left > 0 && SDL_AtomicGet(&this->enabled) ) { in ALSA_PlayDevice()
213 int status = snd_pcm_writei(this->hidden->pcm_handle, sample_buf, frames_left); in ALSA_PlayDevice()
236 if (this->hidden->pcm_handle) { in AOS_CloseDevice()
240 Uint32 delay = ((this->spec.samples * 1000) / this->spec.freq) * 2; in AOS_CloseDevice()
243 snd_pcm_drop(this->hidden->pcm_handle); in AOS_CloseDevice()
244 snd_pcm_close(this->hidden->pcm_handle); in AOS_CloseDevice()
246 SDL_free(this->hidden->mixbuf); in AOS_CloseDevice()
247 SDL_free(this->hidden); in AOS_CloseDevice()