From c7d355e57d1bfec6942925624cc2c8ffcead0b5d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Jul 2009 00:24:21 +0200 Subject: [PATCH] Opera compatibility by removing localhost part from path to local files --- projects/mozilla/vlcplugin.cpp | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/projects/mozilla/vlcplugin.cpp b/projects/mozilla/vlcplugin.cpp index 3a49e8e..011cfa5 100644 --- a/projects/mozilla/vlcplugin.cpp +++ b/projects/mozilla/vlcplugin.cpp @@ -504,6 +504,27 @@ relativeurl: ++pathstart; } } + /* + ** ignore the localhost part when protocol is file + ** Opera uses localhost which VLC does not support + */ + const char psz_skipped_protocol[] = "file://"; + const char psz_skipped_host[] = "localhost"; + /* + ** if protocol is file: and there is localhost after it then drop localhost + ** makes URIs like file://localhost/C:/ become file:///C:/ + ** which is what Firefox, Safari use by default and what VLC supports + */ + if + ( + strstr(href, psz_skipped_protocol) == href + && strstr(pathstart, psz_skipped_host) == pathstart + ) + { + // get everything after "localhost" and paste at pathstart location + strcpy(pathstart, pathstart+strlen(psz_skipped_host)); + } + /* skip over host part */ pathstart = strchr(pathstart, '/'); if( ! pathstart ) -- 1.6.3.2.1299.gee46c