vlc | branch: master | Pierre Lamot <pie...@videolabs.io> | Thu Nov 23 09:33:26 
2017 +0100| [5ac115e094c9a1456065ed8ce5431fb2dc415754] | committer: 
Jean-Baptiste Kempf

skin2: fix opening playlist

Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org>

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

 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 );
 }
 
 

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to