Tempo is not read from MP4 files

Bug #1735300 reported by David Baker
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Undecided
Unassigned

Bug Description

It looks like Mixxx is unable to read BPM / tempo tags from MP4 files. I've tested this with both the current stable 2.0.0 download and latest built from master. It reads BPM from mp3 files but for all m4a files, BPM is left blank.

Looking into this, this appears to be because of the atom data type check enabled by the ifdef at https://github.com/mixxxdj/mixxx/blob/master/src/track/trackmetadatataglib.cpp#L1587 . The problem is that taglib doesn't set the atom data type for the 'tmpo' atom, only for freeform atoms (https://github.com/taglib/taglib/blob/4801fbb927c15afab864f7b2f02ad2e07c332ecc/taglib/mp4/mp4tag.cpp#L277) so the type of the 'tmpo' atom is always undefined, meaning the BPM is never read. Removing the check (ie. removing the #define) causes tempo values to be read correctly.

The tmpo atom is always parsed as an int in taglib (https://github.com/taglib/taglib/blob/4801fbb927c15afab864f7b2f02ad2e07c332ecc/taglib/mp4/mp4tag.cpp#L77) so I think the best solution here is to say that atomDataType is only valid for freeform atoms and remove this check (Mixxx doesn't do any equivalent checks for other atom like track numbers).

I'd obviously be happy to send a pull request for this, although it's a trivial patch.

Tags: aac bpm mp4 tempo
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Thanks, I'll revisit this code before releasing the beta! Not sure why I introduced the type check reading my comments ;)

Changed in mixxx:
status: New → In Progress
assignee: nobody → Uwe Klotz (uklotzde)
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Strange. TagLib does not initialize the type discriminator of the internal union even when initialized explicitly with some typed value. Although reading uninitialized bits of an int is not dangerous, it may give unexpected results.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :
Changed in mixxx:
status: In Progress → Fix Committed
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Actually released with 2.1.0

Changed in mixxx:
status: Fix Committed → Fix Released
milestone: none → 2.1.1
Changed in mixxx:
milestone: 2.1.1 → 2.1.0
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8989

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.