From 13228c39d808e51b012ecaeadd818a1581be3ce7 Mon Sep 17 00:00:00 2001 From: Allanis <allanis@saracraft.net> Date: Sat, 23 Feb 2013 20:14:58 +0000 Subject: [PATCH] [Fix?] Eh, some more error checking to prevent seg faults. --- src/land.c | 1 - src/music.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/land.c b/src/land.c index 57bc21f..0989c0f 100644 --- a/src/land.c +++ b/src/land.c @@ -148,7 +148,6 @@ void takeoff(void) { if(!landed) return; music_load(MUSIC_TAKEOFF); - //music_play(); int sw, sh; sw = planet->gfx_space->w; diff --git a/src/music.c b/src/music.c index 3b0b2f5..401d671 100644 --- a/src/music.c +++ b/src/music.c @@ -158,7 +158,8 @@ static int stream_loadBuffer(ALuint buffer) { size += result; if(size == BUFFER_SIZE) break; // Buffer is full. } - alBufferData(buffer, AL_FORMAT_STEREO16, data, BUFFER_SIZE, music_vorbis.info->rate); + // Load the buffer. + alBufferData(buffer, music_vorbis.format, data, BUFFER_SIZE, music_vorbis.info->rate); return 0; } @@ -258,6 +259,7 @@ static void music_free(void) { if(music_vorbis.file.end != 0) { ov_clear(&music_vorbis.stream); pack_close(&music_vorbis.file); + music_vorbis.file.end = 0; // Somewhat ended. } SDL_mutexV(music_vorbis_lock);