mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
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
This commit is contained in:
@@ -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="<<fileURL;
|
||||
|
||||
/* open media */
|
||||
m = libvlc_media_new_path(inst, filename.endsWith("/DVD") ? "dvd://" : filename.toLatin1());
|
||||
m = libvlc_media_new_path(inst, filename.endsWith("/DVD") ? "dvd://" : fileURL.toLatin1());
|
||||
|
||||
/* set the media to playback */
|
||||
if (m) libvlc_media_player_set_media (mp, m);
|
||||
|
||||
Reference in New Issue
Block a user