mirror of
https://github.com/libretro/libretro-prboom.git
synced 2024-11-23 16:09:41 +00:00
Fix segfault when file isn't present.
This commit is contained in:
parent
7847eb828f
commit
d46ab23a7b
@ -844,6 +844,9 @@ boolean I_SoundIsPlaying (int handle)
|
||||
// This function currently supports only 16bit.
|
||||
//
|
||||
|
||||
static const void *music_handle;
|
||||
static void *song_data;
|
||||
|
||||
void I_UpdateSound(void)
|
||||
{
|
||||
// Mix current sound data. Data, from raw sound, for right and left.
|
||||
@ -886,8 +889,10 @@ void I_UpdateSound(void)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
mp_player.render(mad_audio_buf, out_frames);
|
||||
if (music_handle)
|
||||
mp_player.render(mad_audio_buf, out_frames);
|
||||
else
|
||||
memset(mad_audio_buf, 0, out_frames * 4);
|
||||
|
||||
// Determine end, for left channel only (right channel is implicit).
|
||||
leftend = mixbuffer + out_frames * step;
|
||||
@ -1041,9 +1046,6 @@ boolean I_AnySoundStillPlaying(void)
|
||||
// Still no music done.
|
||||
// Remains. Dummies.
|
||||
|
||||
static const void *music_handle;
|
||||
static void *song_data;
|
||||
|
||||
void I_InitMusic(void) { }
|
||||
void I_ShutdownMusic(void) { }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user