Lines Matching refs:this

62     if (this->hidden->audio_fd >= 0) {  in DSP_CloseDevice()
63 close(this->hidden->audio_fd); in DSP_CloseDevice()
65 SDL_free(this->hidden->mixbuf); in DSP_CloseDevice()
66 SDL_free(this->hidden); in DSP_CloseDevice()
90 if (this->spec.channels > 8) in DSP_OpenDevice()
91 this->spec.channels = 8; in DSP_OpenDevice()
92 else if (this->spec.channels > 4) in DSP_OpenDevice()
93 this->spec.channels = 4; in DSP_OpenDevice()
94 else if (this->spec.channels > 2) in DSP_OpenDevice()
95 this->spec.channels = 2; in DSP_OpenDevice()
98 this->hidden = (struct SDL_PrivateAudioData *) in DSP_OpenDevice()
99 SDL_malloc((sizeof *this->hidden)); in DSP_OpenDevice()
100 if (this->hidden == NULL) { in DSP_OpenDevice()
103 SDL_zerop(this->hidden); in DSP_OpenDevice()
106 this->hidden->audio_fd = open(devname, flags, 0); in DSP_OpenDevice()
107 if (this->hidden->audio_fd < 0) { in DSP_OpenDevice()
114 ctlflags = fcntl(this->hidden->audio_fd, F_GETFL); in DSP_OpenDevice()
116 if (fcntl(this->hidden->audio_fd, F_SETFL, ctlflags) < 0) { in DSP_OpenDevice()
122 if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_GETFMTS, &value) < 0) { in DSP_OpenDevice()
129 for (test_format = SDL_FirstAudioFormat(this->spec.format); in DSP_OpenDevice()
182 this->spec.format = test_format; in DSP_OpenDevice()
186 if ((ioctl(this->hidden->audio_fd, SNDCTL_DSP_SETFMT, &value) < 0) || in DSP_OpenDevice()
193 value = this->spec.channels; in DSP_OpenDevice()
194 if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_CHANNELS, &value) < 0) { in DSP_OpenDevice()
198 this->spec.channels = value; in DSP_OpenDevice()
201 value = this->spec.freq; in DSP_OpenDevice()
202 if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_SPEED, &value) < 0) { in DSP_OpenDevice()
206 this->spec.freq = value; in DSP_OpenDevice()
209 SDL_CalculateAudioSpec(&this->spec); in DSP_OpenDevice()
212 for (frag_spec = 0; (0x01U << frag_spec) < this->spec.size; ++frag_spec); in DSP_OpenDevice()
213 if ((0x01U << frag_spec) != this->spec.size) { in DSP_OpenDevice()
223 if (ioctl(this->hidden->audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0) { in DSP_OpenDevice()
229 ioctl(this->hidden->audio_fd, SNDCTL_DSP_GETOSPACE, &info); in DSP_OpenDevice()
239 this->hidden->mixlen = this->spec.size; in DSP_OpenDevice()
240 this->hidden->mixbuf = (Uint8 *) SDL_malloc(this->hidden->mixlen); in DSP_OpenDevice()
241 if (this->hidden->mixbuf == NULL) { in DSP_OpenDevice()
244 SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size); in DSP_OpenDevice()
255 struct SDL_PrivateAudioData *h = this->hidden; in DSP_PlayDevice()
258 SDL_OpenedAudioDeviceDisconnected(this); in DSP_PlayDevice()
268 return (this->hidden->mixbuf); in DSP_GetDeviceBuf()
274 return (int) read(this->hidden->audio_fd, buffer, buflen); in DSP_CaptureFromDevice()
280 struct SDL_PrivateAudioData *h = this->hidden; in DSP_FlushCapture()