From 6b2d5b6d640112b8273a1fe58fabb7bab2fb8385 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 7 Feb 2004 06:18:56 +0000 Subject: [PATCH] implement pause properly. works for me, hopefully for others --- libs/audio/cd/cd_file.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/libs/audio/cd/cd_file.c b/libs/audio/cd/cd_file.c index 9a5f71d92..a1914d2d1 100644 --- a/libs/audio/cd/cd_file.c +++ b/libs/audio/cd/cd_file.c @@ -195,15 +195,27 @@ I_OGGMus_Pause (void) if (!tracklist || !mus_enabled || !playing) return; - if (cd_sfx) { - cd_sfx->close (cd_sfx); - cd_channel->sfx = NULL; + if (cd_channel) { + cd_channel->master_vol = 0; + cd_channel->leftvol = cd_channel->rightvol = 0; } wasPlaying = playing; playing = false; } +/* unpause. might just cheat and restart playing */ +static void +I_OGGMus_Resume (void) +{ + if (!tracklist || !mus_enabled || !wasPlaying) + return; + + set_volume (); + wasPlaying = false; + playing = true; +} + /* start playing, if we've got a trackmap. * cry if we can't find a file to play */ static void @@ -255,17 +267,6 @@ I_OGGMus_Play (int track, qboolean looping) current_track = track; } -/* unpause. might just cheat and restart playing */ -static void -I_OGGMus_Resume (void) -{ - if (!tracklist || !mus_enabled || !wasPlaying) - return; - - I_OGGMus_Play (current_track, true); - playing = true; -} - /* print out the current track map, in numerical order. */ static void I_OGGMus_Info (void)