[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [phonon/five] src: Create a player backend object when calling Player::play()
From:       Casian Andrei <skeletk13 () gmail ! com>
Date:       2014-07-02 13:13:51
Message-ID: E1X2KMB-0003rz-VS () scm ! kde ! org
[Download RAW message or body]

Git commit d65fb9245d62912e8b8587ed61acaf8f7096b459 by Casian Andrei.
Committed on 02/07/2014 at 13:08.
Pushed by casianandrei into branch 'five'.

Create a player backend object when calling Player::play()

When calling play() from the simpleplayer demo application, no backend
object was created and the application did not do anything. Ensure the
backend object is present when attempting to play.

Make PlayerPrivate constructor call the FrontendPrivate constructor to
make sure the m_backendObject attribute is initialized to 0.

M  +2    -0    src/player.cpp
M  +2    -1    src/player_p.h

http://commits.kde.org/phonon/d65fb9245d62912e8b8587ed61acaf8f7096b459

diff --git a/src/player.cpp b/src/player.cpp
index 345c579..7d02d71 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -99,6 +99,8 @@ qint64 Player::time() const
 void Player::play()
 {
     P_D(Player);
+    if (!d->m_backendObject)
+        d->createBackendObject();
     if (d->interface)
         d->interface->play();
 }
diff --git a/src/player_p.h b/src/player_p.h
index f9eac83..d63f9ab 100644
--- a/src/player_p.h
+++ b/src/player_p.h
@@ -50,7 +50,8 @@ protected:
     void _p_stateChanged(Phonon::State newState, Phonon::State oldState);
 =

     PlayerPrivate()
-        : tickInterval(0)
+        : FrontendPrivate()
+        , tickInterval(0)
         , metaData()
         , state(Phonon::StoppedState)
         , abstractStream(0)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic