summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-03-31 13:49:35 +0100
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-03-31 14:33:19 +0100
commit6ac2419622eadb54c86e24c6a57824c7f78b07ac (patch)
treea59f465a6271e113bb23398f48b3c952695c7213 /src
parent91ba0239bcaca91e5d07b685e53ecd3ce13d58ba (diff)
Ensure Phonon MMF backend emits aboutToFinish
It seems that, after a call to CMdaAudioPlayerUtility::SetPosition, the reported position values are slightly lower than they should be. This, combined with the fact that the backend emitted aboutToFinish from its timer tick slot, means that the aboutToFinish signal is sometimes not emitted at the end of an audio clip, if the position has been advanced by seeking during playback. This patch adds a check in the implementation of the MMdaAudioPlayerCallback::MapcPlayComplete callback - if, at this point, aboutToFinish has not been emitted, it is emitted now. Task-number: QTBUG-9368 Reviewed-by: trustme
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.cpp13
-rw-r--r--src/3rdparty/phonon/mmf/abstractmediaplayer.h2
2 files changed, 10 insertions, 5 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
index 544762aa11..6356c21dd5 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp
@@ -369,6 +369,13 @@ void MMF::AbstractMediaPlayer::playbackComplete(int error)
{
stopTimers();
+ if (KErrNone == error && !m_aboutToFinishSent) {
+ const qint64 total = totalTime();
+ emit MMF::AbstractPlayer::tick(total);
+ m_aboutToFinishSent = true;
+ emit aboutToFinish();
+ }
+
if (KErrNone == error) {
changeState(StoppedState);
@@ -393,15 +400,13 @@ qint64 MMF::AbstractMediaPlayer::toMilliSeconds(const TTimeIntervalMicroSeconds
void MMF::AbstractMediaPlayer::positionTick()
{
- emitMarksIfReached();
-
const qint64 current = currentTime();
+ emitMarksIfReached(current);
emit MMF::AbstractPlayer::tick(current);
}
-void MMF::AbstractMediaPlayer::emitMarksIfReached()
+void MMF::AbstractMediaPlayer::emitMarksIfReached(qint64 current)
{
- const qint64 current = currentTime();
const qint64 total = totalTime();
const qint64 remaining = total - current;
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
index abd6bff6e4..308b5af91f 100644
--- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h
+++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h
@@ -91,7 +91,7 @@ private:
void stopBufferStatusTimer();
void stopTimers();
void doVolumeChanged();
- void emitMarksIfReached();
+ void emitMarksIfReached(qint64 position);
void resetMarksIfRewound();
private Q_SLOTS: