[vlc-commits] Playlist status not being updated on play/pause

Mal Graty git at videolan.org
Mon Dec 12 23:05:17 CET 2011


vlc/vlc-1.2 | branch: master | Mal Graty <madmalibu at gmail.com> | Mon Dec 12 00:13:44 2011 +0000| [a101344fc91965b0120750f4272886804dc478fa] | committer: Jean-Baptiste Kempf

Playlist status not being updated on play/pause

Fix issue #4899

The problem was that the playing/paused state was being misreported
to the luahttp interface, turns out this was due to the way the playing
state was being updated in the Qt and hotkey logic.

The p_input state was being updated, but the playlist wasn't being
informed, this patch switches out the p_state calls to use the
equivalent playlist aware functions.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 48a98edcc66626a2292f8c9f8d697fa8244736af)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=a101344fc91965b0120750f4272886804dc478fa
---

 modules/control/hotkeys.c         |   13 ++-----------
 modules/gui/qt4/input_manager.cpp |   17 +++--------------
 modules/gui/qt4/input_manager.hpp |    1 -
 3 files changed, 5 insertions(+), 26 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index f6b9c69..74e74f0 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -301,17 +301,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
                 ClearChannels( p_intf, p_vout );
 
                 int state = var_GetInteger( p_input, "state" );
-                if( state != PAUSE_S )
-                {
-                    DisplayIcon( p_vout, OSD_PAUSE_ICON );
-                    state = PAUSE_S;
-                }
-                else
-                {
-                    DisplayIcon( p_vout, OSD_PLAY_ICON );
-                    state = PLAYING_S;
-                }
-                var_SetInteger( p_input, "state", state );
+                DisplayIcon( p_vout, state != PAUSE_S ? OSD_PAUSE_ICON : OSD_PLAY_ICON );
+                playlist_Pause( p_playlist );
             }
             else
                 playlist_Play( p_playlist );
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 1022266..3320263 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -737,17 +737,6 @@ void InputManager::sliderUpdate( float new_pos )
     emit seekRequested( new_pos );
 }
 
-/* User togglePlayPause */
-void InputManager::togglePlayPause()
-{
-    if( hasInput() )
-    {
-        int state = var_GetInteger( p_input, "state" );
-        state = ( state != PLAYING_S ) ? PLAYING_S : PAUSE_S;
-        var_SetInteger( p_input, "state", state );
-    }
-}
-
 void InputManager::sectionPrev()
 {
     if( hasInput() )
@@ -1121,7 +1110,7 @@ void MainInputManager::togglePlayPause()
     if( !p_input )
         playlist_Play( THEPL );
     else
-        getIM()->togglePlayPause();
+        playlist_Pause( THEPL );
 }
 
 void MainInputManager::play()
@@ -1133,7 +1122,7 @@ void MainInputManager::play()
     {
         if( PLAYING_S != var_GetInteger( p_input, "state" ) )
         {
-            getIM()->togglePlayPause();
+            playlist_Pause( THEPL );
         }
     }
 }
@@ -1142,7 +1131,7 @@ void MainInputManager::pause()
 {
     if(p_input && PLAYING_S == var_GetInteger( p_input, "state" ) )
     {
-        getIM()->togglePlayPause();
+        playlist_Pause( THEPL );
     }
 }
 
diff --git a/modules/gui/qt4/input_manager.hpp b/modules/gui/qt4/input_manager.hpp
index 406911c..f10aa89 100644
--- a/modules/gui/qt4/input_manager.hpp
+++ b/modules/gui/qt4/input_manager.hpp
@@ -207,7 +207,6 @@ public slots:
     void setAtoB();
 
 private slots:
-    void togglePlayPause();
     void AtoBLoop( float, int64_t, int );
 
 signals:



More information about the vlc-commits mailing list