Merge lp:~jhodapp/qtubuntu-media/fix-1435088 into lp:qtubuntu-media

Proposed by Jim Hodapp on 2015-05-01
Status: Merged
Approved by: Nick Dedekind on 2015-05-22
Approved revision: 72
Merged at revision: 74
Proposed branch: lp:~jhodapp/qtubuntu-media/fix-1435088
Merge into: lp:qtubuntu-media
Diff against target: 33 lines (+6/-4)
2 files modified
src/aal/aalmediaplayercontrol.cpp (+4/-1)
src/aal/aalmediaplayerservice.cpp (+2/-3)
To merge this branch: bzr merge lp:~jhodapp/qtubuntu-media/fix-1435088
Reviewer Review Type Date Requested Status
Nick Dedekind (community) 2015-05-01 Approve on 2015-05-22
PS Jenkins bot continuous-integration Needs Fixing on 2015-05-01
Review via email: mp+258076@code.launchpad.net

Commit Message

Make sure that stopped and ready (same state for QMediaPlayer) are reported to the client app.

Description of the Change

Make sure that stopped and ready (same state for QMediaPlayer) are reported to the client app.

To post a comment you must log in.
Nick Dedekind (nick-dedekind) wrote :

24 + qDebug() << "PlaybackStatus changed to: " << m_newStatus;

you want this debug message?

review: Needs Information
Jim Hodapp (jhodapp) wrote :

> 24 + qDebug() << "PlaybackStatus changed to: " << m_newStatus;
>
> you want this debug message?

Yes I do, that's definitely on purpose and quite useful for some of the types of issues the media stack has been having lately.

Nick Dedekind (nick-dedekind) wrote :

Ok, all good then :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/aal/aalmediaplayercontrol.cpp'
2--- src/aal/aalmediaplayercontrol.cpp 2015-04-27 20:54:31 +0000
3+++ src/aal/aalmediaplayercontrol.cpp 2015-05-01 20:04:02 +0000
4@@ -333,7 +333,10 @@
5
6 void AalMediaPlayerControl::setState(QMediaPlayer::State state)
7 {
8- if (state != m_state)
9+ // Because QMediaPlayer doesn't have a Ready state and GStreamer does, make sure the
10+ // stateChanged() signal is emited when either Stopped or Ready is passed in.
11+ bool do_state_changed = (state == QMediaPlayer::StoppedState && m_state == QMediaPlayer::StoppedState);
12+ if (state != m_state || do_state_changed)
13 {
14 m_state = state;
15 Q_EMIT stateChanged(m_state);
16
17=== modified file 'src/aal/aalmediaplayerservice.cpp'
18--- src/aal/aalmediaplayerservice.cpp 2015-03-19 21:14:12 +0000
19+++ src/aal/aalmediaplayerservice.cpp 2015-05-01 20:04:02 +0000
20@@ -547,11 +547,10 @@
21 // the app is notified about this so it can change it's status
22 switch (m_newStatus)
23 {
24+ qDebug() << "PlaybackStatus changed to: " << m_newStatus;
25 case media::Player::PlaybackStatus::ready:
26- break;
27 case media::Player::PlaybackStatus::stopped:
28- // FIXME: Disabled for now since this causes next/previous to not work in music-app
29- //m_mediaPlayerControl->setState(QMediaPlayer::StoppedState);
30+ m_mediaPlayerControl->setState(QMediaPlayer::StoppedState);
31 break;
32 case media::Player::PlaybackStatus::paused:
33 m_mediaPlayerControl->setState(QMediaPlayer::PausedState);

Subscribers

People subscribed via source and target branches