From 72073d7ed6e8872bb533f91a6281d9c1f72a6803 Mon Sep 17 00:00:00 2001 From: zicodxx Date: Fri, 8 Jul 2011 01:46:27 +0200 Subject: [PATCH] Make sure hmp_reset() is only executed if a song was playing --- CHANGELOG.txt | 1 + arch/sdl/digi.c | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 03d0a8f89..355c934be 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ D1X-Rebirth Changelog 20110708 -------- main/net_udp.c: Slight improvement for Packet Loss Prevention: Be able to send to 35 packets per call of net_udp_noloss_process_queue() and also let counter only increase if a packet was actually sent, making sure the queue is not stuck on the first 5 packets in the list +arch/sdl/digi.c: Make sure hmp_reset() is only executed if a song was playing 20110704 -------- diff --git a/arch/sdl/digi.c b/arch/sdl/digi.c index 37058bf86..f241fb609 100644 --- a/arch/sdl/digi.c +++ b/arch/sdl/digi.c @@ -186,12 +186,11 @@ void digi_win32_resume_midi_song() void digi_win32_stop_current_song() { - if (digi_win32_midi_song_playing) - { - hmp_close(cur_hmp); - cur_hmp = NULL; - digi_win32_midi_song_playing = 0; - } + if (!digi_win32_midi_song_playing) + return; + hmp_close(cur_hmp); + cur_hmp = NULL; + digi_win32_midi_song_playing = 0; hmp_reset(); } #endif