Skip to content

Commit

Permalink
Return EALREADY if already in requested playback mode.
Browse files Browse the repository at this point in the history
That's what the BeBook says the method is suppose to do.
  • Loading branch information
jscipione committed Dec 24, 2012
1 parent b83bece commit ff3409e
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/kits/game/FileGameSound.cpp
Expand Up @@ -331,27 +331,28 @@ BFileGameSound::Perform(int32 selector,
status_t
BFileGameSound::SetPaused(bool isPaused, bigtime_t rampTime)
{
if (fPaused != isPaused) {
Lock();

// Clear any old ramping
delete fPausing;
fPausing = NULL;

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);
}
if (fPaused == isPaused)
return EALREADY;

Lock();

// 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;
}

Expand Down

0 comments on commit ff3409e

Please sign in to comment.