[Fix?] Eh, some more error checking to prevent seg faults.
This commit is contained in:
parent
15599909a0
commit
13228c39d8
@ -148,7 +148,6 @@ void takeoff(void) {
|
||||
if(!landed) return;
|
||||
|
||||
music_load(MUSIC_TAKEOFF);
|
||||
//music_play();
|
||||
|
||||
int sw, sh;
|
||||
sw = planet->gfx_space->w;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user