From 63f0f22270455648d31a190089be58317a45b9cd Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 12 Apr 2017 19:04:46 +0200 Subject: [PATCH] Make search_for_file() understand URLs. --- image_input.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/image_input.cpp b/image_input.cpp index e763ad5..a3a110c 100644 --- a/image_input.cpp +++ b/image_input.cpp @@ -44,6 +44,17 @@ string search_for_file(const string &filename) return filename; } + // See if we match ^[a-z]:/, which is probably a URL of some sort + // (FFmpeg understands various forms of these). + for (size_t i = 0; i < filename.size() - 1; ++i) { + if (filename[i] == ':' && filename[i + 1] == '/') { + return filename; + } + if (!isalpha(filename[i])) { + break; + } + } + // Look for the file in all theme_dirs until we find one; // that will be the permanent resolution of this file, whether // it is actually valid or not. -- 2.39.2