[vlc-devel] [PATCH] skin2: fix opening playlist

Pierre Lamot pierre at videolabs.io
Wed Nov 22 14:24:16 CET 2017


  dialog already provides an URL
---
 include/vlc_playlist.h                       | 2 +-
 modules/gui/skins2/commands/cmd_playlist.cpp | 2 +-
 modules/gui/skins2/commands/cmd_playlist.hpp | 6 +++---
 src/playlist/loadsave.c                      | 6 ++----
 4 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 9498e622ca..183f763b23 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -345,7 +345,7 @@ VLC_API int playlist_Export( playlist_t *p_playlist, const char *psz_name,
 /**
  * Open a playlist file, add its content to the current playlist
  */
-VLC_API int playlist_Import( playlist_t *p_playlist, const char *psz_file );
+VLC_API int playlist_Import( playlist_t *p_playlist, const char *psz_uri );
 
 /********************** Services discovery ***********************/
 
diff --git a/modules/gui/skins2/commands/cmd_playlist.cpp b/modules/gui/skins2/commands/cmd_playlist.cpp
index dc38840dda..547394962d 100644
--- a/modules/gui/skins2/commands/cmd_playlist.cpp
+++ b/modules/gui/skins2/commands/cmd_playlist.cpp
@@ -64,7 +64,7 @@ void CmdPlaylistRepeat::execute()
 
 void CmdPlaylistLoad::execute()
 {
-    playlist_Import( getPL(), m_file.c_str() );
+    playlist_Import( getPL(), m_uri.c_str() );
 }
 
 
diff --git a/modules/gui/skins2/commands/cmd_playlist.hpp b/modules/gui/skins2/commands/cmd_playlist.hpp
index bbbde615bd..f769f80821 100644
--- a/modules/gui/skins2/commands/cmd_playlist.hpp
+++ b/modules/gui/skins2/commands/cmd_playlist.hpp
@@ -110,15 +110,15 @@ private:
 class CmdPlaylistLoad: public CmdGeneric
 {
 public:
-    CmdPlaylistLoad( intf_thread_t *pIntf, const std::string& rFile )
-                   : CmdGeneric( pIntf ), m_file( rFile ) { }
+    CmdPlaylistLoad( intf_thread_t *pIntf, const std::string& rUri )
+                   : CmdGeneric( pIntf ), m_uri( rUri ) { }
     virtual ~CmdPlaylistLoad() { }
     virtual void execute();
     virtual std::string getType() const { return "playlist load"; }
 
 private:
     /// Playlist file to load
-    std::string m_file;
+    std::string m_uri;
 };
 
 
diff --git a/src/playlist/loadsave.c b/src/playlist/loadsave.c
index 05d6b9038e..2638b3f852 100644
--- a/src/playlist/loadsave.c
+++ b/src/playlist/loadsave.c
@@ -89,16 +89,14 @@ out:
    return ret;
 }
 
-int playlist_Import( playlist_t *p_playlist, const char *psz_file )
+int playlist_Import( playlist_t *p_playlist, const char *psz_uri )
 {
     input_item_t *p_input;
-    char *psz_uri = vlc_path2uri( psz_file, NULL );
 
     if( psz_uri == NULL )
         return VLC_EGENERIC;
 
-    p_input = input_item_New( psz_uri, psz_file );
-    free( psz_uri );
+    p_input = input_item_New( psz_uri, NULL );
 
     playlist_AddInput( p_playlist, p_input, false, true );
 
-- 
2.14.1



More information about the vlc-devel mailing list