[vlc-commits] dbus: use playlist_ViewPlay() instead of PLAYLIST_GO

Rémi Denis-Courmont git at videolan.org
Sun May 14 18:39:38 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 14 17:57:09 2017 +0300| [f7770d42a8d232237e01ff9427c98d0143956869] | committer: Rémi Denis-Courmont

dbus: use playlist_ViewPlay() instead of PLAYLIST_GO

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

 modules/control/dbus/dbus_tracklist.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/control/dbus/dbus_tracklist.c b/modules/control/dbus/dbus_tracklist.c
index 899171a76e..aa3b6ba037 100644
--- a/modules/control/dbus/dbus_tracklist.c
+++ b/modules/control/dbus/dbus_tracklist.c
@@ -89,7 +89,7 @@ DBUS_METHOD( AddTrack )
         return DBUS_HANDLER_RESULT_NEED_MEMORY;
 
     playlist_t *p_playlist = PL;
-    playlist_item_t *node;
+    playlist_item_t *node, *plitem;
 
     PL_LOCK;
     node = p_playlist->p_playing;
@@ -109,8 +109,10 @@ DBUS_METHOD( AddTrack )
         }
     }
 
-    playlist_NodeAddInput( p_playlist, item, node,
-                           (b_play == TRUE) ? PLAYLIST_GO : 0, i_pos );
+    plitem = playlist_NodeAddInput( p_playlist, item, node, 0, i_pos );
+    if( likely(plitem != NULL) && b_play )
+        playlist_ViewPlay( p_playlist, NULL, plitem );
+
     PL_UNLOCK;
 
     input_item_Release( item );



More information about the vlc-commits mailing list