From ff3409e005096a604d862a776e470aae2089865d Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 24 Dec 2012 15:27:41 -0500 Subject: [PATCH] Return EALREADY if already in requested playback mode. That's what the BeBook says the method is suppose to do. --- src/kits/game/FileGameSound.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/kits/game/FileGameSound.cpp b/src/kits/game/FileGameSound.cpp index f26c76645b..085add4b4b 100644 --- a/src/kits/game/FileGameSound.cpp +++ b/src/kits/game/FileGameSound.cpp @@ -331,27 +331,28 @@ BFileGameSound::Perform(int32 selector, status_t BFileGameSound::SetPaused(bool isPaused, bigtime_t rampTime) { - if (fPaused != isPaused) { - Lock(); + if (fPaused == isPaused) + return EALREADY; - // Clear any old ramping - delete fPausing; - fPausing = NULL; + Lock(); - if (rampTime > 100000) { - // Setup for ramping - if (isPaused) - fPausing = InitRamp(&fPauseGain, 0.0, - Format().frame_rate, rampTime); - else - fPausing = InitRamp(&fPauseGain, 1.0, - Format().frame_rate, rampTime); - } + // Clear any old ramping + delete fPausing; + fPausing = NULL; - fPaused = isPaused; - Unlock(); + if (rampTime > 100000) { + // Setup for ramping + if (isPaused) + fPausing = InitRamp(&fPauseGain, 0.0, + Format().frame_rate, rampTime); + else + fPausing = InitRamp(&fPauseGain, 1.0, + Format().frame_rate, rampTime); } + fPaused = isPaused; + Unlock(); + return B_OK; }