mp4: Consider track/disc number <= 0 as invalid and missing

This commit is contained in:
Uwe Klotz 2024-01-13 18:51:46 +01:00 committed by Alex
parent 76915d72bb
commit 26fb51dce6

View file

@ -599,16 +599,24 @@ impl SplitTag for Ilst {
let current = u16::from_be_bytes([data[2], data[3]]);
let total = u16::from_be_bytes([data[4], data[5]]);
tag.insert_text(ItemKey::TrackNumber, current.to_string());
tag.insert_text(ItemKey::TrackTotal, total.to_string());
if current > 0 {
tag.insert_text(ItemKey::TrackNumber, current.to_string());
}
if total > 0 {
tag.insert_text(ItemKey::TrackTotal, total.to_string());
}
return false; // Atom consumed
},
b"disk" => {
let current = u16::from_be_bytes([data[2], data[3]]);
let total = u16::from_be_bytes([data[4], data[5]]);
tag.insert_text(ItemKey::DiscNumber, current.to_string());
tag.insert_text(ItemKey::DiscTotal, total.to_string());
if current > 0 {
tag.insert_text(ItemKey::DiscNumber, current.to_string());
}
if total > 0 {
tag.insert_text(ItemKey::DiscTotal, total.to_string());
}
return false; // Atom consumed
},
_ => {},