Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue reading cpil field from m4a tags. #457

Closed
milesegan opened this issue Sep 11, 2024 · 3 comments · Fixed by #460
Closed

Possible issue reading cpil field from m4a tags. #457

milesegan opened this issue Sep 11, 2024 · 3 comments · Fixed by #460
Labels
bug Something isn't working
Milestone

Comments

@milesegan
Copy link

Reproducer

Repo for reproduction is here:

https://github.com/milesegan/lofty-aac-compilation-bug

Summary

There seems to be an error reading the cpil compilation flag field from m4a tags. In the sample file the value is 1 but the tag reads as 0.

Expected behavior

No response

Assets

No response

@milesegan milesegan added the bug Something isn't working label Sep 11, 2024
@milesegan
Copy link
Author

It seems like maybe the issue is here?

let data = match content[..] {
[0, ..] => AtomData::Bool(false),
_ => AtomData::Bool(true),
};

When I read the tag the content is [0, 0, 0, 1] which gets parsed as false. Maybe an endian issue?

@Serial-ATA
Copy link
Owner

Yep, that's exactly where the issue is :)

These flag atoms seem to be pretty inconsistently implemented. Quite a few projects write a 1 byte flag (which is what I thought was correct). It seems like other tools (including iTunes) write an i32, though. Guess I'll have to account for both encodings during parsing.

@Serial-ATA Serial-ATA added this to the 0.22.0 milestone Sep 11, 2024
@milesegan
Copy link
Author

It sounds tricky! Please let me know if I can help out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants