diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-09-24 14:46:50 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-09-24 14:46:50 (GMT) |
commit | c952036e999144e654c63c515aee3b2ea6507e3f (patch) | |
tree | d9b2d9d9063b8a4c07debc1e83f32d9605d55e8c /src/3rdparty/phonon/mmf | |
parent | ba10fb231aaa5cf5512662b94c7f9b3702d2b2ec (diff) | |
download | Qt-c952036e999144e654c63c515aee3b2ea6507e3f.zip Qt-c952036e999144e654c63c515aee3b2ea6507e3f.tar.gz Qt-c952036e999144e654c63c515aee3b2ea6507e3f.tar.bz2 |
Do runtime check for SetVolume.
This was previously in, but apparently disappeared as part of git work.
Addresses review comment.
Diffstat (limited to 'src/3rdparty/phonon/mmf')
-rw-r--r-- | src/3rdparty/phonon/mmf/audioplayer.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 09fdca0..28b57f9 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -93,12 +93,19 @@ void MMF::AudioPlayer::doSeek(qint64 ms) int MMF::AudioPlayer::setDeviceVolume(int mmfVolume) { - /* In SDK 3.1, this function is void. */ + /* In SDK 3.1, SetVolume() returns void. If we're compiling against + * 3.1, we handle it with ifdefs. However, if we compile against a later + * SDK but are _running_ against 3.1, we avoid returning from an undefined + * stack by doing a runtime check of the SDK version. */ #if !defined(__SERIES60_31__) - return m_player->SetVolume(mmfVolume); -#else - m_player->SetVolume(mmfVolume); - return KErrNone; + const int err = m_player->SetVolume(mmfVolume); + if (QSysInfo::s60Version() > QSysInfo::SV_S60_3_1) + return err; + else + return KErrNone; + #else + m_player->SetVolume(mmfVolume); + return KErrNone; #endif } |