[vlc-devel] [PATCH 22/40] playlist: use boolean for playlist_Add() mode parameter

RĂ©mi Denis-Courmont remi at remlab.net
Sun May 14 17:45:52 CEST 2017


---
 include/vlc_playlist.h                       | 2 +-
 modules/control/dbus/dbus_player.c           | 2 +-
 modules/gui/skins2/commands/cmd_add_item.cpp | 2 +-
 src/playlist/item.c                          | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index f97a03bb6e..7f9ec66382 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -361,7 +361,7 @@ VLC_API int playlist_ServicesDiscoveryControl( playlist_t *, const char *, int,
  ********************************************************/
 
 /******************** Item addition ********************/
-VLC_API int playlist_Add( playlist_t *, const char *, int );
+VLC_API int playlist_Add( playlist_t *, const char *, bool );
 VLC_API int playlist_AddExt( playlist_t *, const char *, const char *, int, int, const char *const *, unsigned, bool );
 VLC_API int playlist_AddInput( playlist_t *, input_item_t *, int, bool );
 VLC_API playlist_item_t * playlist_NodeAddInput( playlist_t *, input_item_t *, playlist_item_t *, int, int );
diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index 728cc90260..f7fe6849bd 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -229,7 +229,7 @@ DBUS_METHOD( OpenUri )
         return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
     }
 
-    playlist_Add( PL, psz_mrl, PLAYLIST_GO );
+    playlist_Add( PL, psz_mrl, true );
 
     REPLY_SEND;
 }
diff --git a/modules/gui/skins2/commands/cmd_add_item.cpp b/modules/gui/skins2/commands/cmd_add_item.cpp
index a62a29c9da..e1eba6f9e7 100644
--- a/modules/gui/skins2/commands/cmd_add_item.cpp
+++ b/modules/gui/skins2/commands/cmd_add_item.cpp
@@ -43,5 +43,5 @@ void CmdAddItem::execute()
         m_name = psz_uri;
         free( psz_uri );
     }
-    playlist_Add( pPlaylist, m_name.c_str(), m_playNow ? PLAYLIST_GO : 0 );
+    playlist_Add( pPlaylist, m_name.c_str(), m_playNow );
 }
diff --git a/src/playlist/item.c b/src/playlist/item.c
index fe7898e342..f06e389d94 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -428,13 +428,13 @@ void playlist_Clear( playlist_t * p_playlist, bool b_locked )
  * Add an item to the playlist or the media library
  * \param p_playlist the playlist to add into
  * \param psz_uri the mrl to add to the playlist
- * \param i_mode the mode used when adding
+ * \param play_now whether to start playing immediately or not
  * \return VLC_SUCCESS or a VLC error code
  */
-int playlist_Add( playlist_t *p_playlist, const char *psz_uri, int i_mode )
+int playlist_Add( playlist_t *p_playlist, const char *psz_uri, bool play_now )
 {
     return playlist_AddExt( p_playlist, psz_uri, NULL,
-                            i_mode, 0, NULL, 0, true );
+                            play_now ? PLAYLIST_GO : 0, 0, NULL, 0, true );
 }
 
 /**
-- 
2.11.0



More information about the vlc-devel mailing list