Lines Matching refs:this

123     result = SDL_IOReady(this->hidden->audio_fd, !this->hidden->iscapture, 2 * 1000);  in QSA_WaitDevice()
130 this->hidden->timeout_on_wait = 1; in QSA_WaitDevice()
133 this->hidden->timeout_on_wait = 0; in QSA_WaitDevice()
147 if (!SDL_AtomicGet(&this->enabled) || !this->hidden) { in QSA_PlayDevice()
151 towrite = this->spec.size; in QSA_PlayDevice()
152 pcmbuffer = this->hidden->pcm_buf; in QSA_PlayDevice()
157 snd_pcm_plugin_write(this->hidden->audio_handle, pcmbuffer, in QSA_PlayDevice()
163 if (this->hidden->timeout_on_wait != 0) { in QSA_PlayDevice()
176 pcmbuffer += written * this->spec.channels; in QSA_PlayDevice()
181 if (!this->hidden->iscapture) { in QSA_PlayDevice()
188 snd_pcm_plugin_status(this->hidden->audio_handle, in QSA_PlayDevice()
197 if (!this->hidden->iscapture) { in QSA_PlayDevice()
199 snd_pcm_plugin_prepare(this->hidden-> in QSA_PlayDevice()
204 snd_pcm_plugin_prepare(this->hidden-> in QSA_PlayDevice()
221 pcmbuffer += written * this->spec.channels; in QSA_PlayDevice()
223 } while ((towrite > 0) && SDL_AtomicGet(&this->enabled)); in QSA_PlayDevice()
227 SDL_OpenedAudioDeviceDisconnected(this); in QSA_PlayDevice()
234 return this->hidden->pcm_buf; in QSA_GetDeviceBuf()
240 if (this->hidden->audio_handle != NULL) { in QSA_CloseDevice()
241 if (!this->hidden->iscapture) { in QSA_CloseDevice()
243 snd_pcm_plugin_flush(this->hidden->audio_handle, in QSA_CloseDevice()
247 snd_pcm_plugin_flush(this->hidden->audio_handle, in QSA_CloseDevice()
250 snd_pcm_close(this->hidden->audio_handle); in QSA_CloseDevice()
253 SDL_free(this->hidden->pcm_buf); in QSA_CloseDevice()
254 SDL_free(this->hidden); in QSA_CloseDevice()
269 this->hidden = in QSA_OpenDevice()
274 if (this->hidden == NULL) { in QSA_OpenDevice()
282 this->hidden->iscapture = iscapture ? SDL_TRUE : SDL_FALSE; in QSA_OpenDevice()
286 this->hidden->deviceno = device->deviceno; in QSA_OpenDevice()
287 this->hidden->cardno = device->cardno; in QSA_OpenDevice()
288 status = snd_pcm_open(&this->hidden->audio_handle, in QSA_OpenDevice()
293 status = snd_pcm_open_preferred(&this->hidden->audio_handle, in QSA_OpenDevice()
294 &this->hidden->cardno, in QSA_OpenDevice()
295 &this->hidden->deviceno, in QSA_OpenDevice()
301 this->hidden->audio_handle = NULL; in QSA_OpenDevice()
310 for (test_format = SDL_FirstAudioFormat(this->spec.format); !found;) { in QSA_OpenDevice()
389 this->spec.format = test_format; in QSA_OpenDevice()
395 cparams.format.voices = this->spec.channels; in QSA_OpenDevice()
398 cparams.format.rate = this->spec.freq; in QSA_OpenDevice()
401 status = snd_pcm_plugin_params(this->hidden->audio_handle, &cparams); in QSA_OpenDevice()
408 if (!this->hidden->iscapture) { in QSA_OpenDevice()
415 if (snd_pcm_plugin_setup(this->hidden->audio_handle, &csetup) < 0) { in QSA_OpenDevice()
420 SDL_CalculateAudioSpec(&this->spec); in QSA_OpenDevice()
422 this->hidden->pcm_len = this->spec.size; in QSA_OpenDevice()
424 if (this->hidden->pcm_len == 0) { in QSA_OpenDevice()
425 this->hidden->pcm_len = in QSA_OpenDevice()
426 csetup.buf.block.frag_size * this->spec.channels * in QSA_OpenDevice()
435 this->hidden->pcm_buf = in QSA_OpenDevice()
436 (Uint8 *) SDL_malloc(this->hidden->pcm_len); in QSA_OpenDevice()
437 if (this->hidden->pcm_buf == NULL) { in QSA_OpenDevice()
440 SDL_memset(this->hidden->pcm_buf, this->spec.silence, in QSA_OpenDevice()
441 this->hidden->pcm_len); in QSA_OpenDevice()
444 if (!this->hidden->iscapture) { in QSA_OpenDevice()
445 this->hidden->audio_fd = in QSA_OpenDevice()
446 snd_pcm_file_descriptor(this->hidden->audio_handle, in QSA_OpenDevice()
449 this->hidden->audio_fd = in QSA_OpenDevice()
450 snd_pcm_file_descriptor(this->hidden->audio_handle, in QSA_OpenDevice()
454 if (this->hidden->audio_fd < 0) { in QSA_OpenDevice()
459 if (!this->hidden->iscapture) { in QSA_OpenDevice()
462 snd_pcm_plugin_prepare(this->hidden->audio_handle, in QSA_OpenDevice()
467 snd_pcm_plugin_prepare(this->hidden->audio_handle, in QSA_OpenDevice()