Added "lenient" feature

This commit is contained in:
Vadim Getmanshchuk 2023-02-14 11:21:53 -06:00
parent 4120e1c557
commit 663e0607cf
2 changed files with 2 additions and 0 deletions

View file

@ -16,4 +16,5 @@ chrono = { version = "0.4", default-features = false, features = [ "std" ] }
[features]
default = ["parser"]
parser = ["nom"]
lenient = []

View file

@ -468,6 +468,7 @@ impl AlternativeMedia {
let default = is_yes!(attrs, "DEFAULT");
let autoselect = is_yes!(attrs, "AUTOSELECT");
#[cfg(feature = "lenient")]
if media_type != AlternativeMediaType::Subtitles && attrs.contains_key("FORCED") {
return Err(String::from(
"FORCED attribute must not be included in non-SUBTITLE Alternative Medias",