[vlc-commits] playlist: use the new playlist_Pause() where appropriate

Rémi Denis-Courmont git at videolan.org
Mon Dec 15 18:25:19 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 15 19:22:46 2014 +0200| [43b06eed8eb5bf46e64fb2c9648643dde8cda9c1] | committer: Rémi Denis-Courmont

playlist: use the new playlist_Pause() where appropriate

This fixes corking especially.

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

 modules/control/dbus/dbus_player.c   |    9 +--------
 modules/gui/macosx/CoreInteraction.m |    7 +------
 modules/gui/qt4/input_manager.cpp    |    5 +----
 src/playlist/engine.c                |    2 +-
 4 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index b01c9d9..f1e8a69 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -215,14 +215,7 @@ DBUS_METHOD( Play )
 DBUS_METHOD( Pause )
 {
     REPLY_INIT;
-    input_thread_t *p_input = pl_CurrentInput( p_this );
-
-    if( p_input && var_GetInteger(p_input, "state") == PLAYING_S )
-        playlist_TogglePause( PL );
-
-    if( p_input )
-        vlc_object_release( p_input );
-
+    playlist_Pause( PL );
     REPLY_SEND;
 }
 
diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m
index c4780bf..8233022 100644
--- a/modules/gui/macosx/CoreInteraction.m
+++ b/modules/gui/macosx/CoreInteraction.m
@@ -95,12 +95,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
 {
     playlist_t *p_playlist = pl_Get(VLCIntf);
 
-    PL_LOCK;
-    bool b_playlist_playing = playlist_Status(p_playlist) == PLAYLIST_RUNNING;
-    PL_UNLOCK;
-
-    if (b_playlist_playing)
-        playlist_TogglePause(p_playlist);
+    playlist_Pause(p_playlist);
 }
 
 - (void)stop
diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp
index 4c0df74..25cfccd 100644
--- a/modules/gui/qt4/input_manager.cpp
+++ b/modules/gui/qt4/input_manager.cpp
@@ -1129,10 +1129,7 @@ void MainInputManager::play()
 
 void MainInputManager::pause()
 {
-    if(p_input && PLAYING_S == var_GetInteger( p_input, "state" ) )
-    {
-        playlist_TogglePause( THEPL );
-    }
+    playlist_Pause( THEPL );
 }
 
 void MainInputManager::toggleRandom()
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index edc94dd..742d9e4 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -89,7 +89,7 @@ static int CorksCallback( vlc_object_t *obj, char const *var,
         if( var_InheritBool( obj, "playlist-cork" ) )
         {
             msg_Dbg( obj, "corked" );
-            playlist_TogglePause( pl );
+            playlist_Pause( pl );
         }
         else
             msg_Dbg( obj, "not corked" );



More information about the vlc-commits mailing list