MP4: Stop validating flags for gnre atom upgrade

This commit is contained in:
Serial 2022-12-16 12:18:09 -05:00 committed by Alex
parent 7d1dcef209
commit ecdb7ff878

View file

@ -44,8 +44,8 @@ where
if let Some(atom_data) = parse_data_inner(&mut ilst_reader, &atom)? {
let mut data = Vec::new();
for (flags, content) in atom_data {
if (flags == BE_SIGNED_INTEGER || flags == 0) && content.len() >= 2 {
for (_, content) in atom_data {
if content.len() >= 2 {
let index = content[1] as usize;
if index > 0 && index <= GENRES.len() {
data.push(AtomData::UTF8(String::from(GENRES[index - 1])));
@ -53,11 +53,18 @@ where
}
}
if !data.is_empty() {
let storage = match data.len() {
1 => AtomDataStorage::Single(data.remove(0)),
_ => AtomDataStorage::Multiple(data),
};
tag.atoms.push(Atom {
ident: AtomIdent::Fourcc(*b"\xa9gen"),
data: AtomDataStorage::Multiple(data),
data: storage,
})
}
}
continue;
},