From c952036e999144e654c63c515aee3b2ea6507e3f Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Thu, 24 Sep 2009 16:46:50 +0200 Subject: Do runtime check for SetVolume. This was previously in, but apparently disappeared as part of git work. Addresses review comment. --- src/3rdparty/phonon/mmf/audioplayer.cpp | 17 ++++++++++++----- 1 file 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 } -- cgit v0.12