[Fix?] Eh, some more error checking to prevent seg faults.

This commit is contained in:
Allanis 2013-02-23 20:14:58 +00:00
parent 15599909a0
commit 13228c39d8
2 changed files with 3 additions and 2 deletions

View File

@ -148,7 +148,6 @@ void takeoff(void) {
if(!landed) return;
music_load(MUSIC_TAKEOFF);
//music_play();
int sw, sh;
sw = planet->gfx_space->w;

View File

@ -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);