AvPlayer fix (#3929)

* improved path detection

* clang is pretty

* improved

* improved?

* finished?
This commit is contained in:
georgemoralis
2026-01-16 18:33:27 +02:00
committed by GitHub
parent 11ee79a333
commit dce9c04383

View File

@@ -30,7 +30,15 @@ AvPlayerSourceType GetSourceType(std::string_view path) {
} }
// schema://server.domain/path/to/file.ext/and/beyond -> .ext/and/beyond // schema://server.domain/path/to/file.ext/and/beyond -> .ext/and/beyond
auto ext = name.substr(name.rfind('.'));
// Find extension dot
auto dot_pos = name.rfind('.');
if (dot_pos == std::string_view::npos) {
return AvPlayerSourceType::Unknown;
}
// Extract extension (".ext/anything" or ".ext")
auto ext = name.substr(dot_pos);
if (ext.empty()) { if (ext.empty()) {
return AvPlayerSourceType::Unknown; return AvPlayerSourceType::Unknown;
} }