|
@@ -25,7 +25,6 @@
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
-#include <malloc.h> /* memalign() */
|
|
|
|
|
|
|
|
#include "../SDL_audio_c.h"
|
|
#include "../SDL_audio_c.h"
|
|
#include "../SDL_audiodev_c.h"
|
|
#include "../SDL_audiodev_c.h"
|
|
@@ -96,7 +95,7 @@ static int VITAAUD_OpenDevice(SDL_AudioDevice *_this, const char *devname)
|
|
be a multiple of 64 bytes. Our sample count is already a multiple of
|
|
be a multiple of 64 bytes. Our sample count is already a multiple of
|
|
64, so spec->size should be a multiple of 64 as well. */
|
|
64, so spec->size should be a multiple of 64 as well. */
|
|
mixlen = _this->spec.size * NUM_BUFFERS;
|
|
mixlen = _this->spec.size * NUM_BUFFERS;
|
|
- _this->hidden->rawbuf = (Uint8 *)memalign(64, mixlen);
|
|
|
|
|
|
+ _this->hidden->rawbuf = (Uint8 *)SDL_aligned_alloc(64, mixlen);
|
|
if (_this->hidden->rawbuf == NULL) {
|
|
if (_this->hidden->rawbuf == NULL) {
|
|
return SDL_SetError("Couldn't allocate mixing buffer");
|
|
return SDL_SetError("Couldn't allocate mixing buffer");
|
|
}
|
|
}
|
|
@@ -114,7 +113,7 @@ static int VITAAUD_OpenDevice(SDL_AudioDevice *_this, const char *devname)
|
|
|
|
|
|
_this->hidden->port = sceAudioOutOpenPort(port, _this->spec.samples, _this->spec.freq, format);
|
|
_this->hidden->port = sceAudioOutOpenPort(port, _this->spec.samples, _this->spec.freq, format);
|
|
if (_this->hidden->port < 0) {
|
|
if (_this->hidden->port < 0) {
|
|
- free(_this->hidden->rawbuf);
|
|
|
|
|
|
+ SDL_aligned_free(_this->hidden->rawbuf);
|
|
_this->hidden->rawbuf = NULL;
|
|
_this->hidden->rawbuf = NULL;
|
|
return SDL_SetError("Couldn't open audio out port: %x", _this->hidden->port);
|
|
return SDL_SetError("Couldn't open audio out port: %x", _this->hidden->port);
|
|
}
|
|
}
|
|
@@ -162,7 +161,7 @@ static void VITAAUD_CloseDevice(SDL_AudioDevice *_this)
|
|
}
|
|
}
|
|
|
|
|
|
if (!_this->iscapture && _this->hidden->rawbuf != NULL) {
|
|
if (!_this->iscapture && _this->hidden->rawbuf != NULL) {
|
|
- free(_this->hidden->rawbuf); /* this uses memalign(), not SDL_malloc(). */
|
|
|
|
|
|
+ SDL_aligned_free(_this->hidden->rawbuf);
|
|
_this->hidden->rawbuf = NULL;
|
|
_this->hidden->rawbuf = NULL;
|
|
}
|
|
}
|
|
}
|
|
}
|