[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;
|
if(!landed) return;
|
||||||
|
|
||||||
music_load(MUSIC_TAKEOFF);
|
music_load(MUSIC_TAKEOFF);
|
||||||
//music_play();
|
|
||||||
|
|
||||||
int sw, sh;
|
int sw, sh;
|
||||||
sw = planet->gfx_space->w;
|
sw = planet->gfx_space->w;
|
||||||
|
@ -158,7 +158,8 @@ static int stream_loadBuffer(ALuint buffer) {
|
|||||||
size += result;
|
size += result;
|
||||||
if(size == BUFFER_SIZE) break; // Buffer is full.
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -258,6 +259,7 @@ static void music_free(void) {
|
|||||||
if(music_vorbis.file.end != 0) {
|
if(music_vorbis.file.end != 0) {
|
||||||
ov_clear(&music_vorbis.stream);
|
ov_clear(&music_vorbis.stream);
|
||||||
pack_close(&music_vorbis.file);
|
pack_close(&music_vorbis.file);
|
||||||
|
music_vorbis.file.end = 0; // Somewhat ended.
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_mutexV(music_vorbis_lock);
|
SDL_mutexV(music_vorbis_lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user