mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 04:04:03 -05:00
This commit is contained in:
1 parent
faa9f924c9
commit
8f27c0e8fb
2 files changed
+17
No files matched your search
@@ -526,6 +526,14 @@ static std::string zm_filter_file_option(const std::string &key, const std::stri
|
||||
for (const char *const *k = param_keys; *k; k++) {
|
||||
if (name == *k) deny = true;
|
||||
}
|
||||
// scaling-list also accepts built-in presets, which do not name a file
|
||||
if (deny and name == "scaling-list") {
|
||||
const size_t eq = item.find('=');
|
||||
if (eq != std::string::npos) {
|
||||
const std::string preset = item.substr(eq + 1);
|
||||
if (preset == "off" or preset == "none" or preset == "flat" or preset == "jvt" or preset == "default") deny = false;
|
||||
}
|
||||
}
|
||||
if (deny) {
|
||||
Warning("Ignoring file option '%s' in encoder option %s", name.c_str(), key.c_str());
|
||||
} else if (!item.empty()) {
|
||||
|
||||
@@ -153,3 +153,12 @@ TEST_CASE("zm_parse_options drops file-writing entries spelled with _ or a leadi
|
||||
auto o2 = parse("x265-params=analysis_save=/tmp/a:--csv=/tmp/c:crf=20");
|
||||
REQUIRE(o2["x265-params"] == "crf=20");
|
||||
}
|
||||
|
||||
TEST_CASE("zm_parse_options keeps a built-in scaling-list preset and drops a scaling-list file", "[ffmpeg]") {
|
||||
auto o = parse("x265-params=scaling-list=default:crf=20");
|
||||
REQUIRE(o["x265-params"] == "scaling-list=default:crf=20");
|
||||
o = parse("x264-params=scaling-list=flat:keyint=30");
|
||||
REQUIRE(o["x264-params"] == "scaling-list=flat:keyint=30");
|
||||
o = parse("x264-params=scaling-list=/etc/passwd:keyint=30");
|
||||
REQUIRE(o["x264-params"] == "keyint=30");
|
||||
}
|
||||
Reference in new issue
Block a user