mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-11-10 06:34:18 +00:00
Fix MP4 integer pair writing
This commit is contained in:
parent
3a799dc656
commit
dde40b78db
2 changed files with 9 additions and 6 deletions
|
@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- **ID3v2**: Text is properly encoded when writing
|
||||
- **MP4**: `plID` atom is properly treated as a 64-bit signed integer ([issue](https://github.com/Serial-ATA/lofty-rs/issues/34))
|
||||
- **MP4**: `rate` and `rtng` now map to the correct `ItemKey`
|
||||
- **MP4**: Integer pairs are now written correctly
|
||||
- `TagType` and `FileType` are no longer taken by reference in any method
|
||||
|
||||
### Removed
|
||||
|
|
|
@ -68,15 +68,17 @@ macro_rules! impl_accessor {
|
|||
///
|
||||
/// ### To `Tag`
|
||||
///
|
||||
/// When converting to [`Tag`], only atoms with a value of [`AtomData::UTF8`] and [`AtomData::UTF16`], as
|
||||
/// well as pictures, will be preserved.
|
||||
/// When converting to [`Tag`], only atoms with a value of [`AtomData::UTF8`] and [`AtomData::UTF16`],
|
||||
/// with the exception of the `trkn` and `disk` atoms, as well as pictures, will be preserved.
|
||||
///
|
||||
/// Do note, all pictures will be [`PictureType::Other`](crate::PictureType::Other)
|
||||
///
|
||||
/// ### From `Tag`
|
||||
///
|
||||
/// When converting from [`Tag`], only items with a value of [`ItemValue::Text`](crate::ItemValue::Text), as
|
||||
/// well as pictures, will be preserved
|
||||
/// well as pictures, will be preserved.
|
||||
///
|
||||
/// An attempt will be made to create the `TrackNumber/TrackTotal` (trkn) and `DiscNumber/DiscTotal` (disk) pairs.
|
||||
pub struct Ilst {
|
||||
pub(crate) atoms: Vec<Atom>,
|
||||
}
|
||||
|
@ -311,7 +313,7 @@ impl From<Tag> for Ilst {
|
|||
ident: AtomIdent::Fourcc(ident),
|
||||
data: AtomData::Unknown {
|
||||
code: 0,
|
||||
data: vec![0, 0, current[0], current[1], total[0], total[1]],
|
||||
data: vec![0, 0, current[0], current[1], total[0], total[1], 0, 0],
|
||||
},
|
||||
})
|
||||
},
|
||||
|
@ -578,7 +580,7 @@ mod tests {
|
|||
*b"trkn",
|
||||
&AtomData::Unknown {
|
||||
code: 0,
|
||||
data: vec![0, 0, 0, 1, 0, 0],
|
||||
data: vec![0, 0, 0, 1, 0, 0, 0, 0],
|
||||
},
|
||||
);
|
||||
verify_atom(
|
||||
|
@ -586,7 +588,7 @@ mod tests {
|
|||
*b"disk",
|
||||
&AtomData::Unknown {
|
||||
code: 0,
|
||||
data: vec![0, 0, 0, 1, 0, 2],
|
||||
data: vec![0, 0, 0, 1, 0, 2, 0, 0],
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue