[vlc-commits] skin2: fix opening playlist

Pierre Lamot git at videolan.org
Thu Nov 23 10:17:10 CET 2017


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Nov 23 09:33:26 2017 +0100| [0925621b548c0e2dd3f43233f781718d97228a8f] | committer: Jean-Baptiste Kempf

skin2: fix opening playlist

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/dialogs_provider.cpp          |  9 ++++++++-
 modules/gui/skins2/commands/cmd_playlist.cpp | 10 +++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/dialogs_provider.cpp b/modules/gui/qt/dialogs_provider.cpp
index 4f15bee9c0..4f9f2888ca 100644
--- a/modules/gui/qt/dialogs_provider.cpp
+++ b/modules/gui/qt/dialogs_provider.cpp
@@ -616,7 +616,14 @@ void DialogsProvider::openAPlaylist()
                                         EXT_FILTER_PLAYLIST );
     foreach( const QString &url, urls )
     {
-        playlist_Import( THEPL, qtu( url ) );
+        char* psz_path = vlc_uri2path(qtu( url ));
+        if ( !psz_path )
+        {
+            msg_Warn( p_intf, "unable to load playlist '%s'", qtu( url ) );
+            continue;
+        }
+        playlist_Import( THEPL, psz_path );
+        free( psz_path );
     }
 }
 
diff --git a/modules/gui/skins2/commands/cmd_playlist.cpp b/modules/gui/skins2/commands/cmd_playlist.cpp
index dc38840dda..ab5d94c119 100644
--- a/modules/gui/skins2/commands/cmd_playlist.cpp
+++ b/modules/gui/skins2/commands/cmd_playlist.cpp
@@ -24,6 +24,7 @@
 
 #include "cmd_playlist.hpp"
 #include <vlc_playlist.h>
+#include <vlc_url.h>
 #include "../src/vlcproc.hpp"
 #include "../utils/var_bool.hpp"
 
@@ -64,7 +65,14 @@ void CmdPlaylistRepeat::execute()
 
 void CmdPlaylistLoad::execute()
 {
-    playlist_Import( getPL(), m_file.c_str() );
+    char* psz_path = vlc_uri2path( m_file.c_str() );
+    if ( !psz_path )
+    {
+        msg_Err(getIntf(),"unable to load playlist %s", m_file.c_str() );
+        return;
+    }
+    playlist_Import( getPL(), psz_path );
+    free( psz_path );
 }
 
 



More information about the vlc-commits mailing list