Lines Matching refs:this
48 this->hidden = (struct SDL_PrivateAudioData *) in PSPAUDIO_OpenDevice()
49 SDL_malloc(sizeof(*this->hidden)); in PSPAUDIO_OpenDevice()
50 if (this->hidden == NULL) { in PSPAUDIO_OpenDevice()
53 SDL_zerop(this->hidden); in PSPAUDIO_OpenDevice()
54 switch (this->spec.format & 0xff) { in PSPAUDIO_OpenDevice()
57 this->spec.format = AUDIO_S16LSB; in PSPAUDIO_OpenDevice()
64 this->spec.samples = PSP_AUDIO_SAMPLE_ALIGN(this->spec.samples); in PSPAUDIO_OpenDevice()
65 this->spec.freq = 44100; in PSPAUDIO_OpenDevice()
68 SDL_CalculateAudioSpec(&this->spec); in PSPAUDIO_OpenDevice()
73 mixlen = this->spec.size * NUM_BUFFERS; in PSPAUDIO_OpenDevice()
74 this->hidden->rawbuf = (Uint8 *) memalign(64, mixlen); in PSPAUDIO_OpenDevice()
75 if (this->hidden->rawbuf == NULL) { in PSPAUDIO_OpenDevice()
80 if (this->spec.channels == 1) { in PSPAUDIO_OpenDevice()
83 this->spec.channels = 2; in PSPAUDIO_OpenDevice()
86 this->hidden->channel = sceAudioChReserve(PSP_AUDIO_NEXT_CHANNEL, this->spec.samples, format); in PSPAUDIO_OpenDevice()
87 if (this->hidden->channel < 0) { in PSPAUDIO_OpenDevice()
88 free(this->hidden->rawbuf); in PSPAUDIO_OpenDevice()
89 this->hidden->rawbuf = NULL; in PSPAUDIO_OpenDevice()
93 memset(this->hidden->rawbuf, 0, mixlen); in PSPAUDIO_OpenDevice()
95 this->hidden->mixbufs[i] = &this->hidden->rawbuf[i * this->spec.size]; in PSPAUDIO_OpenDevice()
98 this->hidden->next_buffer = 0; in PSPAUDIO_OpenDevice()
104 Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer]; in PSPAUDIO_PlayDevice()
106 if (this->spec.channels == 1) { in PSPAUDIO_PlayDevice()
107 sceAudioOutputBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, mixbuf); in PSPAUDIO_PlayDevice()
109 …sceAudioOutputPannedBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, mi… in PSPAUDIO_PlayDevice()
112 this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS; in PSPAUDIO_PlayDevice()
122 return this->hidden->mixbufs[this->hidden->next_buffer]; in PSPAUDIO_GetDeviceBuf()
127 if (this->hidden->channel >= 0) { in PSPAUDIO_CloseDevice()
128 sceAudioChRelease(this->hidden->channel); in PSPAUDIO_CloseDevice()
130 free(this->hidden->rawbuf); /* this uses memalign(), not SDL_malloc(). */ in PSPAUDIO_CloseDevice()
131 SDL_free(this->hidden); in PSPAUDIO_CloseDevice()