Skip to content

Commit 8be8910

Browse files
authored
Merge pull request #199 from VodBox/hash-fix
Fix loading local files with a hash in the path
2 parents 5f77ebf + 71faa10 commit 8be8910

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

obs-browser-source.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,18 @@ void BrowserSource::Update(obs_data_t *settings)
425425
n_reroute = obs_data_get_bool(settings, "reroute_audio");
426426

427427
if (n_is_local) {
428+
n_url = CefURIEncode(n_url, false);
429+
430+
#ifdef _WIN32
431+
n_url.replace(n_url.find("%3A"), 3, ":");
432+
#endif
433+
434+
while (n_url.find("%5C") != std::string::npos)
435+
n_url.replace(n_url.find("%5C"), 3, "/");
436+
437+
while (n_url.find("%2F") != std::string::npos)
438+
n_url.replace(n_url.find("%2F"), 3, "/");
439+
428440
#if !ENABLE_LOCAL_FILE_URL_SCHEME
429441
/* http://absolute/ based mapping for older CEF */
430442
n_url = "http://absolute/" + n_url;

0 commit comments

Comments
 (0)