Lines Matching refs:this

132     if (this->hidden->frame_ticks) {  in PAUDIO_WaitDevice()
136 ticks = ((Sint32) (this->hidden->next_frame - SDL_GetTicks())) - FUDGE_TICKS; in PAUDIO_WaitDevice()
144 if (ioctl(this->hidden->audio_fd, AUDIO_BUFFER, &paud_bufinfo) < 0) { in PAUDIO_WaitDevice()
159 if (SDL_IOReady(this->hidden->audio_fd, SDL_TRUE, timeoutMS) <= 0) { in PAUDIO_WaitDevice()
166 SDL_OpenedAudioDeviceDisconnected(this); in PAUDIO_WaitDevice()
168 this->hidden->audio_fd = -1; in PAUDIO_WaitDevice()
183 const Uint8 *mixbuf = this->hidden->mixbuf; in PAUDIO_PlayDevice()
184 const size_t mixlen = this->hidden->mixlen; in PAUDIO_PlayDevice()
188 written = write(this->hidden->audio_fd, mixbuf, mixlen); in PAUDIO_PlayDevice()
196 if (this->hidden->frame_ticks) { in PAUDIO_PlayDevice()
197 this->hidden->next_frame += this->hidden->frame_ticks; in PAUDIO_PlayDevice()
202 SDL_OpenedAudioDeviceDisconnected(this); in PAUDIO_PlayDevice()
212 return this->hidden->mixbuf; in PAUDIO_GetDeviceBuf()
218 if (this->hidden->audio_fd >= 0) { in PAUDIO_CloseDevice()
219 close(this->hidden->audio_fd); in PAUDIO_CloseDevice()
221 SDL_free(this->hidden->mixbuf); in PAUDIO_CloseDevice()
222 SDL_free(this->hidden); in PAUDIO_CloseDevice()
241 this->hidden = (struct SDL_PrivateAudioData *) in PAUDIO_OpenDevice()
242 SDL_malloc((sizeof *this->hidden)); in PAUDIO_OpenDevice()
243 if (this->hidden == NULL) { in PAUDIO_OpenDevice()
246 SDL_zerop(this->hidden); in PAUDIO_OpenDevice()
250 this->hidden->audio_fd = fd; in PAUDIO_OpenDevice()
263 if (this->spec.channels > 1) in PAUDIO_OpenDevice()
264 this->spec.channels = 2; in PAUDIO_OpenDevice()
266 this->spec.channels = 1; in PAUDIO_OpenDevice()
313 paud_init.srate = this->spec.freq; in PAUDIO_OpenDevice()
316 paud_init.channels = this->spec.channels; in PAUDIO_OpenDevice()
320 for (test_format = SDL_FirstAudioFormat(this->spec.format); in PAUDIO_OpenDevice()
375 this->spec.format = test_format; in PAUDIO_OpenDevice()
388 this->spec.samples = paud_bufinfo.write_buf_cap in PAUDIO_OpenDevice()
389 / bytes_per_sample / this->spec.channels; in PAUDIO_OpenDevice()
391 this->spec.samples = paud_bufinfo.write_buf_cap in PAUDIO_OpenDevice()
392 / bytes_per_sample / this->spec.channels / 2; in PAUDIO_OpenDevice()
394 paud_init.bsize = bytes_per_sample * this->spec.channels; in PAUDIO_OpenDevice()
396 SDL_CalculateAudioSpec(&this->spec); in PAUDIO_OpenDevice()
434 this->hidden->mixlen = this->spec.size; in PAUDIO_OpenDevice()
435 this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); in PAUDIO_OpenDevice()
436 if (this->hidden->mixbuf == NULL) { in PAUDIO_OpenDevice()
439 SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); in PAUDIO_OpenDevice()
479 this->hidden->frame_ticks = (float) (this->spec.samples * 1000) / in PAUDIO_OpenDevice()
480 this->spec.freq; in PAUDIO_OpenDevice()
481 this->hidden->next_frame = SDL_GetTicks() + this->hidden->frame_ticks; in PAUDIO_OpenDevice()