From e7a57ed957478dcdfa54ccedfa83afcd1e91cf26 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Sun, 27 Nov 2011 15:03:31 +0000 Subject: [PATCH] VLC Filename convert to file:// URL Passing a filename with spaces in it causes some issues on WinXP/2003, this patch converts all filenames to valid URLs (which is the preferred way to reference media in VLC). Specifically; * The file path is prepended with file:// * backslashes in filenames are converted to forward slashes in URLs * Spaces are converted to %20 --- src/VideoWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/VideoWindow.cpp b/src/VideoWindow.cpp index e6db81ef5..45a8c83b2 100644 --- a/src/VideoWindow.cpp +++ b/src/VideoWindow.cpp @@ -160,8 +160,11 @@ void VideoWindow::mediaSelected(QString filename) if (filename.endsWith("/DVD") || (filename != "" && QFile(filename).exists())) { + QString fileURL = "file://" + filename.replace(" ","%20").replace("\\", "/"); + //qDebug()<<"file url="<