mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
alsa: capture devices don't need a mixbuf allocated.
This commit is contained in:
parent
3ed9b0f567
commit
38f4b68ca7
@ -700,6 +700,7 @@ ALSA_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
|
|||||||
SDL_CalculateAudioSpec(&this->spec);
|
SDL_CalculateAudioSpec(&this->spec);
|
||||||
|
|
||||||
/* Allocate mixing buffer */
|
/* Allocate mixing buffer */
|
||||||
|
if (!iscapture) {
|
||||||
this->hidden->mixlen = this->spec.size;
|
this->hidden->mixlen = this->spec.size;
|
||||||
this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
|
this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
|
||||||
if (this->hidden->mixbuf == NULL) {
|
if (this->hidden->mixbuf == NULL) {
|
||||||
@ -707,6 +708,7 @@ ALSA_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
|
|||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen);
|
SDL_memset(this->hidden->mixbuf, this->spec.silence, this->hidden->mixlen);
|
||||||
|
}
|
||||||
|
|
||||||
/* Switch to blocking mode for playback */
|
/* Switch to blocking mode for playback */
|
||||||
ALSA_snd_pcm_nonblock(pcm_handle, 0);
|
ALSA_snd_pcm_nonblock(pcm_handle, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user