[vlc-commits] core: Remove old medialibrary

Hugo Beauzée-Luyssen git at videolan.org
Tue Jul 17 23:53:53 CEST 2018


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jun  7 15:25:07 2018 +0200| [d36e369e6a8dc6149f1d5323a9e43365b023c319] | committer: Hugo Beauzée-Luyssen

core: Remove old medialibrary

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

 include/vlc_media_library.h                        |  88 ---------------
 include/vlc_playlist.h                             |  14 +--
 modules/control/oldrc.c                            |   4 +-
 modules/control/win_msg.c                          |   3 +-
 .../gui/macosx/VLCConvertAndSaveWindowController.m |   2 +-
 modules/gui/macosx/VLCMainMenu.m                   |   6 +-
 modules/gui/qt/dialogs_provider.cpp                |   2 +-
 modules/gui/qt/recents.cpp                         |   2 +-
 modules/gui/skins2/commands/cmd_playlist.cpp       |   2 +-
 modules/lua/libs/playlist.c                        |   2 +-
 src/playlist/engine.c                              |  23 +---
 src/playlist/item.c                                |  13 +--
 src/playlist/loadsave.c                            | 119 +--------------------
 src/playlist/playlist_internal.h                   |   4 -
 14 files changed, 26 insertions(+), 258 deletions(-)

diff --git a/include/vlc_media_library.h b/include/vlc_media_library.h
index 640c719158..5ef7c621e8 100644
--- a/include/vlc_media_library.h
+++ b/include/vlc_media_library.h
@@ -32,94 +32,6 @@
 extern "C" {
 # endif
 
-/*****************************************************************************
- * ML Enums
- *****************************************************************************/
-
-#define ML_PERSON_ARTIST        "Artist"
-#define ML_PERSON_ALBUM_ARTIST  "Album Artist"
-#define ML_PERSON_ENCODER       "Encoder"
-#define ML_PERSON_PUBLISHER     "Publisher"
-
-
-/** List of Query select types.
- * In a query array or variable argument list, each select type is followed
- * by an argument (X) of variable type (char* or int, @see ml_element_t).
- * These types can be used either in the query list or in the result array.
- * Some types are reserved for the result array:
- */
-typedef enum
-{
-    ML_ALBUM = 1,              /**< Album Title */
-    ML_ALBUM_ID,               /**< Album ID */
-    ML_ALBUM_COVER,            /**< Album Cover art url */
-    /* FIXME: Remove ML_ARTIST */
-    ML_ARTIST,                 /**< Artist, interpreted as ML_PEOPLE
-                                    && ML_PEOPLE_ROLE = ML_PERSON_ARTIST */
-    ML_ARTIST_ID,              /**< Artist ID, interpreted as ML_PEOPLE_ID
-                                    && ML_PEOPLE_ROLE = ML_PERSON_ARTIST */
-    ML_COMMENT,                /**< Comment about media */
-    ML_COUNT_MEDIA,            /**< Number of medias */
-    ML_COUNT_ALBUM,            /**< Number of albums */
-    ML_COUNT_PEOPLE,           /**< Number of people */
-    ML_COVER,                  /**< Cover art url */
-    ML_DURATION,               /**< Duration in ms */
-    ML_DISC_NUMBER,            /**< Disc number of the track */
-    ML_EXTRA,                  /**< Extra/comment (string) on the media */
-    ML_FIRST_PLAYED,           /**< First time media was played */
-    ML_FILESIZE,               /**< Size of the media file */
-    ML_GENRE,                  /**< Genre of the media (if any) */
-    ML_ID,                     /**< Media ID */
-    ML_IMPORT_TIME,            /**< Date when media was imported */
-    ML_LANGUAGE,               /**< Language */
-    ML_LAST_PLAYED,            /**< Last play UNIX timestamp */
-    ML_LAST_SKIPPED,           /**< Time when media was last skipped */
-    ML_ORIGINAL_TITLE,         /**< Media original title (if any) */
-    ML_PEOPLE,                 /**< Any People associated with this media */
-    ML_PEOPLE_ID,              /**< Id of a person */
-    ML_PEOPLE_ROLE,            /**< Person role */
-    ML_PLAYED_COUNT,           /**< Media play count */
-    ML_PREVIEW,                /**< Url of the video preview */
-    ML_SKIPPED_COUNT,          /**< Number of times skipped */
-    ML_SCORE,                  /**< Computed media score */
-    ML_TITLE,                  /**< Media title */
-    ML_TRACK_NUMBER,           /**< Media track number (if any) */
-    ML_TYPE,                   /**< Media type. @see ml_type_e */
-    ML_URI,                    /**< Media full URI. */
-    ML_VOTE,                   /**< Media user vote value */
-    ML_YEAR,                   /**< Media publishing year */
-    ML_DIRECTORY,              /**< Monitored directory */
-    ML_MEDIA,                  /**< Full media descriptor. @see ml_media_t */
-    ML_MEDIA_SPARSE,           /**< Sparse media. @see ml_media_t */
-    ML_MEDIA_EXTRA,            /**< Sparse + Extra = Full media */
-
-    /* Some special elements */
-    ML_LIMIT     = -1,         /**< Limit a query to X results */
-    ML_SORT_DESC = -2,         /**< Sort a query descending on argument X */
-    ML_SORT_ASC  = -3,         /**< Sort a query ascending on argument X */
-    ML_DISTINCT  = -4,         /**< Add DISTINCT to SELECT statements. */
-    ML_END       = -42         /**< End of argument list */
-} ml_select_e;
-
-/** Media types (audio, video, etc...) */
-typedef enum
-{
-    ML_UNKNOWN   = 0,       /**< Unknown media type */
-    ML_AUDIO     = 1 << 0,  /**< Audio only media */
-    ML_VIDEO     = 1 << 1,  /**< Video media. May contain audio channels */
-    ML_STREAM    = 1 << 2,  /**< Streamed media = not a local file */
-    ML_NODE      = 1 << 3,  /**< Nodes like simple nodes, directories, playlists, etc */
-    ML_REMOVABLE = 1 << 4,  /**< Removable media: CD/DVD/Card/... */
-} ml_type_e;
-
-/** Query result item/list type: integers, strings, medias, timestamps */
-typedef enum {
-    ML_TYPE_INT,        /**< Object is an int */
-    ML_TYPE_PSZ,        /**< A string char* */
-    ML_TYPE_TIME,       /**< A timestamp vlc_tick_t */
-    ML_TYPE_MEDIA,      /**< A pointer to a media ml_media_t* */
-} ml_result_type_e;
-
 #ifdef __cplusplus
 }
 #endif /* C++ */
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 5a94eaaae4..51f1d0e82b 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -61,7 +61,6 @@ struct intf_thread_t;
  * Under the playlist root item node, the top-level items are the main
  * media sources and include:
  * - the actual playlist,
- * - the media library,
  * - the service discovery root node, whose children are services discovery
  *   module instances.
  *
@@ -75,8 +74,6 @@ struct intf_thread_t;
  * - playlist (id 1)
  *    - category 1 (id 2)
  *      - foo 2 (id 6 - input 2)
- * - media library (id 2)
- *    - foo 1 (id 5 - input 1)
  * \endverbatim
  *
  * Sometimes, an item creates subitems. This happens for the directory access
@@ -88,8 +85,7 @@ struct intf_thread_t;
  *
  * For "standard" item addition, you can use playlist_Add(), playlist_AddExt()
  * (more options) or playlist_AddInput() if you already created your input
- * item. This will add the item at the root of "Playlist" or of "Media library"
- * in each of the two trees.
+ * item. This will add the item at the root of "Playlist" in each of the two trees.
  *
  * You can create nodes with playlist_NodeCreate() and can create items from
  * existing input items to be placed under any node with
@@ -160,7 +156,6 @@ struct playlist_t
     /* Predefined items */
     playlist_item_t  root;
     playlist_item_t *p_playing;
-    playlist_item_t *p_media_library;
 };
 
 /* A bit of macro magic to generate an enum out of the following list,
@@ -334,13 +329,12 @@ VLC_API int playlist_Status( playlist_t * );
 
 /**
  * Export a node of the playlist to a certain type of playlistfile
- * \param b_playlist true for the playlist, false for the media library
  * \param psz_filename the location where the exported file will be saved
  * \param psz_type the type of playlist file to create (m3u, pls, ..)
  * \return VLC_SUCCESS on success
  */
 VLC_API int playlist_Export( playlist_t *p_playlist, const char *psz_name,
-                             bool b_playlist, const char *psz_type );
+                             const char *psz_type );
 
 /**
  * Open a playlist file, add its content to the current playlist
@@ -374,8 +368,8 @@ VLC_API int playlist_SetRenderer( playlist_t* p_pl, vlc_renderer_item_t* p_item
 
 /******************** Item addition ********************/
 VLC_API int playlist_Add( playlist_t *, const char *, bool );
-VLC_API int playlist_AddExt( playlist_t *, const char *, const char *, bool, int, const char *const *, unsigned, bool );
-VLC_API int playlist_AddInput( playlist_t *, input_item_t *, bool, bool );
+VLC_API int playlist_AddExt( playlist_t *, const char *, const char *, bool, int, const char *const *, unsigned );
+VLC_API int playlist_AddInput( playlist_t *, input_item_t *, bool );
 VLC_API playlist_item_t * playlist_NodeAddInput( playlist_t *, input_item_t *, playlist_item_t *, 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 5ce7764205..4d400e23e7 100644
--- a/modules/control/oldrc.c
+++ b/modules/control/oldrc.c
@@ -1306,7 +1306,7 @@ 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, true, true );
+            int i_ret = playlist_AddInput( p_playlist, p_item, true );
             input_item_Release( p_item );
             if( i_ret != VLC_SUCCESS )
             {
@@ -1322,7 +1322,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
         if( p_item )
         {
             msg_rc( "trying to enqueue %s to playlist", newval.psz_string );
-            int ret =  playlist_AddInput( p_playlist, p_item, false, true );
+            int ret =  playlist_AddInput( p_playlist, p_item, false );
             input_item_Release( p_item );
             if( ret != VLC_SUCCESS )
             {
diff --git a/modules/control/win_msg.c b/modules/control/win_msg.c
index e73465b238..3587c18d6f 100644
--- a/modules/control/win_msg.c
+++ b/modules/control/win_msg.c
@@ -103,8 +103,7 @@ static LRESULT CALLBACK WMCOPYWNDPROC(HWND hwnd, UINT uMsg,
                         NULL, (i_opt == 0 && !p_data->enqueue),
                         i_options,
                         (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ),
-                        VLC_INPUT_OPTION_TRUSTED,
-                        true );
+                        VLC_INPUT_OPTION_TRUSTED );
 
                 i_opt += i_options;
                 free( psz_URI );
diff --git a/modules/gui/macosx/VLCConvertAndSaveWindowController.m b/modules/gui/macosx/VLCConvertAndSaveWindowController.m
index abdaefb2bb..91bda74f16 100644
--- a/modules/gui/macosx/VLCConvertAndSaveWindowController.m
+++ b/modules/gui/macosx/VLCConvertAndSaveWindowController.m
@@ -290,7 +290,7 @@
         input_item_AddOption(p_input, [[NSString stringWithFormat:@"ttl=%@", [_streamTTLField stringValue]] UTF8String], VLC_INPUT_OPTION_TRUSTED);
 
     int returnValue;
-    returnValue = playlist_AddInput(p_playlist, p_input, false, true );
+    returnValue = playlist_AddInput(p_playlist, p_input, false );
 
     if (returnValue == VLC_SUCCESS) {
         /* let's "play" */
diff --git a/modules/gui/macosx/VLCMainMenu.m b/modules/gui/macosx/VLCMainMenu.m
index 7d93b81146..e0a22d6506 100644
--- a/modules/gui/macosx/VLCMainMenu.m
+++ b/modules/gui/macosx/VLCMainMenu.m
@@ -1183,7 +1183,7 @@
 
             playlist_Export(p_playlist,
                             [actualFilename fileSystemRepresentation],
-                            true, "export-m3u");
+                            "export-m3u");
         } else if ([_playlistSaveAccessoryPopup indexOfSelectedItem] == 1) {
             NSString *actualFilename;
             NSRange range;
@@ -1197,7 +1197,7 @@
 
             playlist_Export(p_playlist,
                             [actualFilename fileSystemRepresentation],
-                            true, "export-xspf");
+                            "export-xspf");
         } else {
             NSString *actualFilename;
             NSRange range;
@@ -1211,7 +1211,7 @@
 
             playlist_Export(p_playlist,
                             [actualFilename fileSystemRepresentation],
-                            true, "export-html");
+                            "export-html");
         }
     }
 }
diff --git a/modules/gui/qt/dialogs_provider.cpp b/modules/gui/qt/dialogs_provider.cpp
index 27212bd769..32ee5b0d22 100644
--- a/modules/gui/qt/dialogs_provider.cpp
+++ b/modules/gui/qt/dialogs_provider.cpp
@@ -677,7 +677,7 @@ void DialogsProvider::savePlayingToPlaylist()
 
     if ( psz_selected_module )
     {
-        playlist_Export( THEPL, qtu( toNativeSeparators( file ) ), true,
+        playlist_Export( THEPL, qtu( toNativeSeparators( file ) ),
                          psz_selected_module );
         getSettings()->setValue( "last-playlist-ext", psz_last_playlist_ext );
     }
diff --git a/modules/gui/qt/recents.cpp b/modules/gui/qt/recents.cpp
index 5aa190ed31..914f378c41 100644
--- a/modules/gui/qt/recents.cpp
+++ b/modules/gui/qt/recents.cpp
@@ -211,7 +211,7 @@ int Open::openMRLwithOptions( intf_thread_t* p_intf,
 
     /* Add to playlist */
     int i_ret = playlist_AddExt( THEPL, qtu(mrl), title, b_start,
-                  i_options, ppsz_options, VLC_INPUT_OPTION_TRUSTED, true );
+                  i_options, ppsz_options, VLC_INPUT_OPTION_TRUSTED );
 
     /* Add to recent items, only if played */
     if( i_ret == VLC_SUCCESS && b_start )
diff --git a/modules/gui/skins2/commands/cmd_playlist.cpp b/modules/gui/skins2/commands/cmd_playlist.cpp
index ab5d94c119..7555c80e39 100644
--- a/modules/gui/skins2/commands/cmd_playlist.cpp
+++ b/modules/gui/skins2/commands/cmd_playlist.cpp
@@ -91,7 +91,7 @@ void CmdPlaylistSave::execute()
         return;
     }
 
-    playlist_Export( getPL(), m_file.c_str(), true, psz_module );
+    playlist_Export( getPL(), m_file.c_str(), psz_module );
 }
 
 void CmdPlaylistFirst::execute()
diff --git a/modules/lua/libs/playlist.c b/modules/lua/libs/playlist.c
index 895447334e..e6ba0eed24 100644
--- a/modules/lua/libs/playlist.c
+++ b/modules/lua/libs/playlist.c
@@ -195,7 +195,7 @@ static int vlclua_playlist_add_common(lua_State *L, bool play)
         {
             /* Play or Enqueue (preparse) */
             /* FIXME: playlist_AddInput() can fail */
-            playlist_AddInput(playlist, item, play, true);
+            playlist_AddInput(playlist, item, play);
             input_item_Release(item);
             count++;
         }
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index c5f9879a96..400396a41f 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -236,26 +236,19 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
     p_playlist->root.i_id = 0;
     p_playlist->root.i_flags = 0;
 
-    /* Create the root, playing items and meida library nodes */
-    playlist_item_t *playing, *ml;
+    /* Create the root, playing items nodes */
+    playlist_item_t *playing;
 
     PL_LOCK;
     playing = playlist_NodeCreate( p_playlist, _( "Playlist" ),
                                    &p_playlist->root, PLAYLIST_END,
                                    PLAYLIST_RO_FLAG|PLAYLIST_NO_INHERIT_FLAG );
-    if( var_InheritBool( p_parent, "media-library") )
-        ml = playlist_NodeCreate( p_playlist, _( "Media Library" ),
-                                  &p_playlist->root, PLAYLIST_END,
-                                  PLAYLIST_RO_FLAG|PLAYLIST_NO_INHERIT_FLAG );
-    else
-        ml = NULL;
     PL_UNLOCK;
 
     if( unlikely(playing == NULL) )
         abort();
 
     p_playlist->p_playing = playing;
-    p_playlist->p_media_library = ml;
 
     /* Initial status */
     pl_priv(p_playlist)->status.p_item = NULL;
@@ -263,9 +256,6 @@ playlist_t *playlist_Create( vlc_object_t *p_parent )
     pl_priv(p_playlist)->request.b_request = false;
     p->request.input_dead = false;
 
-    if (ml != NULL)
-        playlist_MLLoad( p_playlist );
-
     /* Input resources */
     p->p_input_resource = input_resource_New( VLC_OBJECT( p_playlist ) );
     if( unlikely(p->p_input_resource == NULL) )
@@ -325,9 +315,6 @@ void playlist_Destroy( playlist_t *p_playlist )
     if( p_sys->p_renderer )
         vlc_renderer_item_release( p_sys->p_renderer );
 
-    if( p_playlist->p_media_library != NULL )
-        playlist_MLDump( p_playlist );
-
     PL_LOCK;
     /* Release the current node */
     set_current_status_node( p_playlist, NULL );
@@ -339,12 +326,6 @@ void playlist_Destroy( playlist_t *p_playlist )
     ARRAY_RESET( p_playlist->current );
 
     /* Remove all remaining items */
-    if( p_playlist->p_media_library != NULL )
-    {
-        playlist_NodeDeleteExplicit( p_playlist, p_playlist->p_media_library,
-            PLAYLIST_DELETE_FORCE );
-    }
-
     playlist_NodeDeleteExplicit( p_playlist, p_playlist->p_playing,
         PLAYLIST_DELETE_FORCE );
 
diff --git a/src/playlist/item.c b/src/playlist/item.c
index 4458de8435..b8deef464c 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -453,7 +453,7 @@ void playlist_Clear( playlist_t * p_playlist, bool b_locked )
 int playlist_Add( playlist_t *p_playlist, const char *psz_uri, bool play_now )
 {
     return playlist_AddExt( p_playlist, psz_uri, NULL, play_now,
-                            0, NULL, 0, true );
+                            0, NULL, 0 );
 }
 
 /**
@@ -466,20 +466,18 @@ int playlist_Add( playlist_t *p_playlist, const char *psz_uri, bool play_now )
  * \param i_options the number of options
  * \param ppsz_options an array of options
  * \param i_option_flags options flags
- * \param b_playlist TRUE for playlist, FALSE for media library
  * \return VLC_SUCCESS or a VLC error code
 */
 int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
                      const char *psz_name, bool play_now,
                      int i_options, const char *const *ppsz_options,
-                     unsigned i_option_flags,
-                     bool b_playlist )
+                     unsigned i_option_flags )
 {
     input_item_t *p_input = input_item_New( psz_uri, psz_name );
     if( !p_input )
         return VLC_ENOMEM;
     input_item_AddOptions( p_input, i_options, ppsz_options, i_option_flags );
-    int i_ret = playlist_AddInput( p_playlist, p_input, play_now, b_playlist );
+    int i_ret = playlist_AddInput( p_playlist, p_input, play_now );
     input_item_Release( p_input );
     return i_ret;
 }
@@ -494,11 +492,10 @@ int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,
  * \return VLC_SUCCESS or VLC_ENOMEM or VLC_EGENERIC
 */
 int playlist_AddInput( playlist_t* p_playlist, input_item_t *p_input,
-                       bool play_now, bool b_playlist )
+                       bool play_now)
 {
     PL_LOCK;
-    playlist_item_t *item = b_playlist ? p_playlist->p_playing
-                                       : p_playlist->p_media_library;
+    playlist_item_t *item = p_playlist->p_playing;
 
     item = playlist_NodeAddInput( p_playlist, p_input, item, PLAYLIST_END );
 
diff --git a/src/playlist/loadsave.c b/src/playlist/loadsave.c
index 178ec1fbb4..790aed4031 100644
--- a/src/playlist/loadsave.c
+++ b/src/playlist/loadsave.c
@@ -39,15 +39,14 @@
 #include <vlc_modules.h>
 
 int playlist_Export( playlist_t * p_playlist, const char *psz_filename,
-                     bool b_playlist, const char *psz_type )
+                     const char *psz_type )
 {
     playlist_export_t *p_export =
         vlc_custom_create( p_playlist, sizeof( *p_export ), "playlist export" );
     if( unlikely(p_export == NULL) )
         return VLC_ENOMEM;
 
-    msg_Dbg( p_export, "saving %s to file %s",
-             b_playlist ? "playlist" : "media library", psz_filename );
+    msg_Dbg( p_export, "saving playlist to file %s", psz_filename );
 
     int ret = VLC_EGENERIC;
 
@@ -65,8 +64,7 @@ int playlist_Export( playlist_t * p_playlist, const char *psz_filename,
 
     /* And call the module ! All work is done now */
     playlist_Lock( p_playlist );
-    p_export->p_root = b_playlist ? p_playlist->p_playing
-                                  : p_playlist->p_media_library;
+    p_export->p_root = p_playlist->p_playing;
 
     p_module = module_need( p_export, "playlist export", psz_type, true );
     playlist_Unlock( p_playlist );
@@ -100,7 +98,7 @@ int playlist_Import( playlist_t *p_playlist, const char *psz_file )
     p_input = input_item_New( psz_uri, psz_file );
     free( psz_uri );
 
-    playlist_AddInput( p_playlist, p_input, false, true );
+    playlist_AddInput( p_playlist, p_input, false );
 
     vlc_object_t *dummy = vlc_object_create( p_playlist, sizeof (*dummy) );
     var_Create( dummy, "meta-file", VLC_VAR_VOID );
@@ -110,112 +108,3 @@ int playlist_Import( playlist_t *p_playlist, const char *psz_file )
     vlc_object_release( dummy );
     return ret;
 }
-
-/*****************************************************************************
- * A subitem has been added to the Media Library (Event Callback)
- *****************************************************************************/
-static void input_item_subitem_tree_added( const vlc_event_t * p_event,
-                                      void * user_data )
-{
-    playlist_t *p_playlist = user_data;
-    input_item_node_t *p_root =
-        p_event->u.input_item_subitem_tree_added.p_root;
-
-    PL_LOCK;
-    playlist_InsertInputItemTree ( p_playlist, p_playlist->p_media_library,
-                                   p_root, 0, false );
-    PL_UNLOCK;
-}
-
-int playlist_MLLoad( playlist_t *p_playlist )
-{
-    char *psz_datadir = config_GetUserDir( VLC_USERDATA_DIR );
-    if( !psz_datadir ) /* XXX: This should never happen */
-    {
-        msg_Err( p_playlist, "no data directory, cannot load media library") ;
-        return VLC_EGENERIC;
-    }
-
-    char *psz_file;
-    if( asprintf( &psz_file, "%s" DIR_SEP "ml.xspf", psz_datadir ) == -1 )
-        psz_file = NULL;
-    free( psz_datadir );
-    if( psz_file == NULL )
-        return VLC_ENOMEM;
-
-    /* lousy check for media library file */
-    struct stat st;
-    if( vlc_stat( psz_file, &st ) )
-    {
-        free( psz_file );
-        return VLC_EGENERIC;
-    }
-
-    char *psz_uri = vlc_path2uri( psz_file, "file/directory" );
-    free( psz_file );
-    if( psz_uri == NULL )
-        return VLC_ENOMEM;
-
-    input_item_t *p_input = input_item_New( psz_uri, _("Media Library") );
-    free( psz_uri );
-    if( p_input == NULL )
-        return VLC_EGENERIC;
-
-    vlc_event_attach( &p_input->event_manager, vlc_InputItemSubItemTreeAdded,
-                        input_item_subitem_tree_added, p_playlist );
-
-    vlc_object_t *dummy = vlc_object_create( p_playlist, sizeof (*dummy) );
-    var_Create( dummy, "meta-file", VLC_VAR_VOID );
-    input_Read( dummy, p_input );
-    vlc_object_release( dummy );
-
-    vlc_event_detach( &p_input->event_manager, vlc_InputItemSubItemTreeAdded,
-                        input_item_subitem_tree_added, p_playlist );
-    input_item_Release( p_input );
-
-    return VLC_SUCCESS;
-}
-
-int playlist_MLDump( playlist_t *p_playlist )
-{
-    char *psz_temp;
-
-    psz_temp = config_GetUserDir( VLC_USERDATA_DIR );
-
-    if( !psz_temp ) /* XXX: This should never happen */
-    {
-        msg_Err( p_playlist, "no data directory, cannot save media library") ;
-        return VLC_EGENERIC;
-    }
-
-    char psz_dirname[ strlen( psz_temp ) + sizeof( DIR_SEP "ml.xspf")];
-    strcpy( psz_dirname, psz_temp );
-    free( psz_temp );
-    if( config_CreateDir( (vlc_object_t *)p_playlist, psz_dirname ) )
-    {
-        return VLC_EGENERIC;
-    }
-
-    strcat( psz_dirname, DIR_SEP "ml.xspf" );
-
-    if ( asprintf( &psz_temp, "%s.tmp%"PRIu32, psz_dirname, (uint32_t)getpid() ) < 1 )
-        return VLC_EGENERIC;
-
-    int i_ret = playlist_Export( p_playlist, psz_temp, false, "export-xspf" );
-    if ( i_ret != VLC_SUCCESS )
-    {
-        vlc_unlink( psz_temp );
-        free( psz_temp );
-        return i_ret;
-    }
-
-    i_ret = vlc_rename( psz_temp, psz_dirname );
-    free( psz_temp );
-    if( i_ret == -1 )
-    {
-        msg_Err( p_playlist, "could not rename %s.tmp: %s",
-                 psz_dirname, vlc_strerror_c(errno) );
-        return VLC_EGENERIC;
-    }
-    return VLC_SUCCESS;
-}
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index 659b86dab7..3ed57c2a53 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -109,10 +109,6 @@ playlist_item_t * get_current_status_node( playlist_t * p_playlist );
 void set_current_status_item( playlist_t *, playlist_item_t * );
 void set_current_status_node( playlist_t *, playlist_item_t * );
 
-/* Load/Save */
-int playlist_MLLoad( playlist_t *p_playlist );
-int playlist_MLDump( playlist_t *p_playlist );
-
 /**********************************************************************
  * Item management
  **********************************************************************/



More information about the vlc-commits mailing list