summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/mmf/mediaobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/phonon/mmf/mediaobject.cpp')
-rw-r--r--src/3rdparty/phonon/mmf/mediaobject.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp
index 29ac2df..f004fd7 100644
--- a/src/3rdparty/phonon/mmf/mediaobject.cpp
+++ b/src/3rdparty/phonon/mmf/mediaobject.cpp
@@ -239,6 +239,7 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
const bool oldPlayerSeekable = oldPlayer->isSeekable();
Phonon::ErrorType error = NoError;
+ QString errorMessage;
// Determine media type
switch (source.type()) {
@@ -253,7 +254,7 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
mediaType = fileMediaType(url.toLocalFile());
}
else {
- TRACE_0("Network streaming not supported yet");
+ errorMessage = QLatin1String("Network streaming not supported yet");
error = NormalError;
}
}
@@ -286,7 +287,8 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
newPlayer = new DummyPlayer();
}
- newPlayer->setError(NormalError);
+ error = NormalError;
+ errorMessage = tr("Media type could not be determined");
break;
case MediaTypeAudio:
@@ -320,10 +322,13 @@ void MMF::MediaObject::createPlayer(const MediaSource &source)
connect(m_player.data(), SIGNAL(stateChanged(Phonon::State, Phonon::State)), SIGNAL(stateChanged(Phonon::State, Phonon::State)));
connect(m_player.data(), SIGNAL(finished()), SIGNAL(finished()));
connect(m_player.data(), SIGNAL(tick(qint64)), SIGNAL(tick(qint64)));
+ connect(m_player.data(), SIGNAL(metaDataChanged(const QMultiMap<QString, QString>&)), SIGNAL(metaDataChanged(const QMultiMap<QString, QString>&)));
- if (error != NoError ) {
- newPlayer = new DummyPlayer();
- newPlayer->setError(error);
+ // We need to call setError() after doing the connects, otherwise the
+ // error won't be received.
+ if (error != NoError) {
+ Q_ASSERT(m_player);
+ m_player->setError(error, errorMessage);
}
TRACE_EXIT_0();