mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Cleanup
This commit is contained in:
parent
f952123095
commit
56f9d0a7cf
@ -111,20 +111,23 @@ void audio_mix_free_chunk(audio_chunk_t *chunk)
|
||||
audio_chunk_t* audio_mix_load_wav_file(const char *path, int sample_rate)
|
||||
{
|
||||
int sample_size;
|
||||
ssize_t len = 0;
|
||||
void *buf = NULL;
|
||||
audio_chunk_t *chunk = (audio_chunk_t*)calloc(1, sizeof(*chunk));
|
||||
|
||||
if (!chunk)
|
||||
return NULL;
|
||||
|
||||
chunk->sample_rate = sample_rate;
|
||||
|
||||
if (!filestream_read_file(path, &chunk->buf, &chunk->len))
|
||||
if (!filestream_read_file(path, &buf, &len))
|
||||
{
|
||||
printf("Could not open WAV file for reading.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
chunk->rwav = (rwav_t*)malloc(sizeof(rwav_t));
|
||||
chunk->sample_rate = sample_rate;
|
||||
chunk->buf = buf;
|
||||
chunk->len = len;
|
||||
chunk->rwav = (rwav_t*)malloc(sizeof(rwav_t));
|
||||
|
||||
if (rwav_load(chunk->rwav, chunk->buf, chunk->len) == RWAV_ITERATE_ERROR)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user