Lines Matching refs:this
171 const int written = SNDIO_sio_write(this->hidden->dev, in SNDIO_PlayDevice()
172 this->hidden->mixbuf, in SNDIO_PlayDevice()
173 this->hidden->mixlen); in SNDIO_PlayDevice()
177 SDL_OpenedAudioDeviceDisconnected(this); in SNDIO_PlayDevice()
192 r = SNDIO_sio_read(this->hidden->dev, buffer, buflen); in SNDIO_CaptureFromDevice()
193 while (r == 0 && !SNDIO_sio_eof(this->hidden->dev)) { in SNDIO_CaptureFromDevice()
194 if ((nfds = SNDIO_sio_pollfd(this->hidden->dev, this->hidden->pfd, POLLIN)) <= 0 in SNDIO_CaptureFromDevice()
195 || poll(this->hidden->pfd, nfds, INFTIM) < 0) { in SNDIO_CaptureFromDevice()
198 revents = SNDIO_sio_revents(this->hidden->dev, this->hidden->pfd); in SNDIO_CaptureFromDevice()
200 r = SNDIO_sio_read(this->hidden->dev, buffer, buflen); in SNDIO_CaptureFromDevice()
214 while (SNDIO_sio_read(this->hidden->dev, buf, sizeof(buf)) != 0) { in SNDIO_FlushCapture()
222 return this->hidden->mixbuf; in SNDIO_GetDeviceBuf()
228 if ( this->hidden->pfd != NULL ) { in SNDIO_CloseDevice()
229 SDL_free(this->hidden->pfd); in SNDIO_CloseDevice()
231 if ( this->hidden->dev != NULL ) { in SNDIO_CloseDevice()
232 SNDIO_sio_stop(this->hidden->dev); in SNDIO_CloseDevice()
233 SNDIO_sio_close(this->hidden->dev); in SNDIO_CloseDevice()
235 SDL_free(this->hidden->mixbuf); in SNDIO_CloseDevice()
236 SDL_free(this->hidden); in SNDIO_CloseDevice()
242 SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format); in SNDIO_OpenDevice()
246 this->hidden = (struct SDL_PrivateAudioData *) in SNDIO_OpenDevice()
247 SDL_malloc(sizeof(*this->hidden)); in SNDIO_OpenDevice()
248 if (this->hidden == NULL) { in SNDIO_OpenDevice()
251 SDL_zerop(this->hidden); in SNDIO_OpenDevice()
253 this->hidden->mixlen = this->spec.size; in SNDIO_OpenDevice()
256 if ((this->hidden->dev = in SNDIO_OpenDevice()
263 if (iscapture && (this->hidden->pfd = in SNDIO_OpenDevice()
264 SDL_malloc(sizeof(struct pollfd) * SNDIO_sio_nfds(this->hidden->dev))) == NULL) { in SNDIO_OpenDevice()
270 par.rate = this->spec.freq; in SNDIO_OpenDevice()
271 par.pchan = this->spec.channels; in SNDIO_OpenDevice()
272 par.round = this->spec.samples; in SNDIO_OpenDevice()
283 if (SNDIO_sio_setpar(this->hidden->dev, &par) == 0) { in SNDIO_OpenDevice()
286 if (SNDIO_sio_getpar(this->hidden->dev, &par) == 0) { in SNDIO_OpenDevice()
305 this->spec.format = AUDIO_S32LSB; in SNDIO_OpenDevice()
307 this->spec.format = AUDIO_S32MSB; in SNDIO_OpenDevice()
309 this->spec.format = AUDIO_S16LSB; in SNDIO_OpenDevice()
311 this->spec.format = AUDIO_S16MSB; in SNDIO_OpenDevice()
313 this->spec.format = AUDIO_U16LSB; in SNDIO_OpenDevice()
315 this->spec.format = AUDIO_U16MSB; in SNDIO_OpenDevice()
317 this->spec.format = AUDIO_S8; in SNDIO_OpenDevice()
319 this->spec.format = AUDIO_U8; in SNDIO_OpenDevice()
324 this->spec.freq = par.rate; in SNDIO_OpenDevice()
325 this->spec.channels = par.pchan; in SNDIO_OpenDevice()
326 this->spec.samples = par.round; in SNDIO_OpenDevice()
329 SDL_CalculateAudioSpec(&this->spec); in SNDIO_OpenDevice()
332 this->hidden->mixlen = this->spec.size; in SNDIO_OpenDevice()
333 this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); in SNDIO_OpenDevice()
334 if (this->hidden->mixbuf == NULL) { in SNDIO_OpenDevice()
337 SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen); in SNDIO_OpenDevice()
339 if (!SNDIO_sio_start(this->hidden->dev)) { in SNDIO_OpenDevice()