[vlc-commits] playlist: remove locked parameter to playlist_AddInput()

Rémi Denis-Courmont git at videolan.org
Wed Nov 16 23:05:07 CET 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Nov 16 23:42:00 2016 +0200| [9d2aa1f9f170767c88dee6777f6532bc33db9594] | committer: Rémi Denis-Courmont

playlist: remove locked parameter to playlist_AddInput()

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

 include/vlc_playlist.h  |  2 +-
 modules/control/oldrc.c |  8 +++-----
 modules/lua/vlc.c       |  2 +-
 src/playlist/item.c     | 10 ++++------
 src/playlist/loadsave.c |  2 +-
 5 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index eda3a6c..6a421d6 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -335,7 +335,7 @@ VLC_API int playlist_DeleteFromInput( playlist_t *, input_item_t *, bool );
 /******************** Item addition ********************/
 VLC_API int playlist_Add( playlist_t *, const char *, const char *, int, int, bool );
 VLC_API int playlist_AddExt( playlist_t *, const char *, const char *, int, int, mtime_t, int, const char *const *, unsigned, bool );
-VLC_API int playlist_AddInput( playlist_t *, input_item_t *, int, int, bool, bool );
+VLC_API int playlist_AddInput( playlist_t *, input_item_t *, int, int, bool );
 VLC_API playlist_item_t * playlist_NodeAddInput( playlist_t *, input_item_t *, playlist_item_t *, int, int );
 VLC_API int playlist_NodeAddCopy( playlist_t *, playlist_item_t *, playlist_item_t *, int );
 
diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c
index 4dedf15..ea5748b 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -1296,9 +1296,8 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
         if( p_item )
         {
             msg_rc( "Trying to add %s to playlist.", newval.psz_string );
-            int i_ret =playlist_AddInput( p_playlist, p_item,
-                     PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END, true,
-                     pl_Unlocked );
+            int i_ret = playlist_AddInput( p_playlist, p_item,
+                     PLAYLIST_GO|PLAYLIST_APPEND, PLAYLIST_END, true );
             vlc_gc_decref( p_item );
             if( i_ret != VLC_SUCCESS )
             {
@@ -1315,8 +1314,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
         {
             msg_rc( "trying to enqueue %s to playlist", newval.psz_string );
             if( playlist_AddInput( p_playlist, p_item,
-                               PLAYLIST_APPEND, PLAYLIST_END, true,
-                               pl_Unlocked ) != VLC_SUCCESS )
+                         PLAYLIST_APPEND, PLAYLIST_END, true ) != VLC_SUCCESS )
             {
                 return VLC_EGENERIC;
             }
diff --git a/modules/lua/vlc.c b/modules/lua/vlc.c
index 46c4e9d..0a1cc70 100644
--- a/modules/lua/vlc.c
+++ b/modules/lua/vlc.c
@@ -580,7 +580,7 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
                         playlist_AddInput( p_playlist, p_input,
                                PLAYLIST_APPEND |
                                ( b_play ? PLAYLIST_GO : PLAYLIST_PREPARSE ),
-                               PLAYLIST_END, true, false );
+                               PLAYLIST_END, true );
                     i_count ++; /* increment counter */
                     vlc_gc_decref( p_input );
                     while( i_options > 0 )
diff --git a/src/playlist/item.c b/src/playlist/item.c
index 8bf8e71..1058a2e 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -420,7 +420,7 @@ int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
         return VLC_ENOMEM;
     input_item_AddOptions( p_input, i_options, ppsz_options, i_option_flags );
     i_ret = playlist_AddInput( p_playlist, p_input, i_mode, i_pos,
-                               b_playlist, false );
+                               b_playlist );
     vlc_gc_decref( p_input );
     return i_ret;
 }
@@ -435,21 +435,19 @@ int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
  *        PLAYLIST_END the item will be added at the end of the playlist
  *        regardless of its size
  * \param b_playlist TRUE for playlist, FALSE for media library
- * \param b_locked TRUE if the playlist is locked
  * \return VLC_SUCCESS or VLC_ENOMEM or VLC_EGENERIC
 */
 int playlist_AddInput( playlist_t* p_playlist, input_item_t *p_input,
-                       int i_mode, int i_pos, bool b_playlist,
-                       bool b_locked )
+                       int i_mode, int i_pos, bool b_playlist )
 {
     playlist_item_t *item;
 
-    PL_LOCK_IF( !b_locked );
+    PL_LOCK;
     item = b_playlist ? p_playlist->p_playing
                       : p_playlist->p_media_library;
 
     item = playlist_NodeAddInput( p_playlist, p_input, item, i_mode, i_pos );
-    PL_UNLOCK_IF( !b_locked );
+    PL_UNLOCK;
     return (item != NULL) ? VLC_SUCCESS : VLC_ENOMEM;
 }
 
diff --git a/src/playlist/loadsave.c b/src/playlist/loadsave.c
index 0114cef..4e4d1e0 100644
--- a/src/playlist/loadsave.c
+++ b/src/playlist/loadsave.c
@@ -100,7 +100,7 @@ int playlist_Import( playlist_t *p_playlist, const char *psz_file )
     free( psz_uri );
 
     playlist_AddInput( p_playlist, p_input, PLAYLIST_APPEND, PLAYLIST_END,
-                       true, false );
+                       true );
 
     vlc_object_t *dummy = vlc_object_create( p_playlist, sizeof (*dummy) );
     var_Create( dummy, "meta-file", VLC_VAR_VOID );



More information about the vlc-commits mailing list