mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-14 14:42:33 +00:00
MP4: Stop validating flags for gnre
atom upgrade
This commit is contained in:
parent
7d1dcef209
commit
ecdb7ff878
1 changed files with 13 additions and 6 deletions
|
@ -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,10 +53,17 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
tag.atoms.push(Atom {
|
||||
ident: AtomIdent::Fourcc(*b"\xa9gen"),
|
||||
data: AtomDataStorage::Multiple(data),
|
||||
})
|
||||
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: storage,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue