From 5c57392ce17168517566c7ea34d9d29947f07f04 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 8 Oct 2008 00:19:33 +0200 Subject: [PATCH] Remove unnecessary check in CStreamPlayer::Request(). Don't check for iState & EInited in CStreamPlayer::Request(), as that condition is always true in every place Request() is called. --- src/audio/symbian/streamplayer.cpp | 51 ++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/src/audio/symbian/streamplayer.cpp b/src/audio/symbian/streamplayer.cpp index 6c13f6e..58986ee 100644 --- a/src/audio/symbian/streamplayer.cpp +++ b/src/audio/symbian/streamplayer.cpp @@ -144,35 +144,32 @@ void CStreamPlayer::Close() void CStreamPlayer::Request() { - if(iState & EInited) - { - iPtr.Set(KNullDesC8); + iPtr.Set(KNullDesC8); - if(iState & EVolumeChange) - { - const TReal newVol = iVolume; - const TReal newMax = MaxVolume(); - const int maxVol = iStream->MaxVolume(); - const TReal max = static_cast(maxVol); - const TReal newvolume = (newVol * max) / newMax; - const int vol = static_cast(newvolume); - iStream->SetVolume(vol); - iState &= ~EVolumeChange; - } + if(iState & EVolumeChange) + { + const TReal newVol = iVolume; + const TReal newMax = MaxVolume(); + const int maxVol = iStream->MaxVolume(); + const TReal max = static_cast(maxVol); + const TReal newvolume = (newVol * max) / newMax; + const int vol = static_cast(newvolume); + iStream->SetVolume(vol); + iState &= ~EVolumeChange; + } - if(iState & EStarted) - { - iPtr.Set(iProvider.Data()); - } - if(iPtr.Length() == 0) - { - iPtr.Set(iSilence); - } - TRAPD(err, iStream->WriteL(iPtr)); - if(err != KErrNone) - { - iObs.Complete(MStreamObs::EWrite, err); - } + if(iState & EStarted) + { + iPtr.Set(iProvider.Data()); + } + if(iPtr.Length() == 0) + { + iPtr.Set(iSilence); + } + TRAPD(err, iStream->WriteL(iPtr)); + if(err != KErrNone) + { + iObs.Complete(MStreamObs::EWrite, err); } } -- 2.11.4.GIT