mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-01-31 00:55:19 +01:00
AvPlayer fix (#3929)
* improved path detection * clang is pretty * improved * improved? * finished?
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user