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

Fixes mp3 lenght when no ID3v1 tag is added #11168

Merged
merged 12 commits into from
Mar 29, 2023
Merged

Conversation

daschuer
Copy link
Member

Without an ID3v1 tag, the MAD_BUFFER_GUARD padding byte after the last frame are missing and the last frame was not considered when calculating the track length. This PR uses a local m_leftoverBuffer to add these padding bytes. An existing solution that was already in place when decoding the file.

This also fixes spurious warnings that happens because of a legacy off-by-one issue. Due to a validity test on the seek destination, the decoding starts with the next frame after the seek target. The bug itself cannot be fixed, because it would make the stored analysis, cues and loops invalid.

This PR fixes also the wrong clearing of the bit reservoir after switching to the m_leftoverBuffer. This is relevant in case of VBR encoded tracks.

If this is merged before merging #11162 the waveform of tracks without an ID3v1 tracks will be off at the end of the track.

Fixes #11159

@daschuer
Copy link
Member Author

@robbert-vdh has confirmed that this PR fixes the issue.
Is this a 2.3.5 candidate?

daschuer and others added 3 commits March 29, 2023 21:53
Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
Co-authored-by: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com>
Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@Swiftb0y Swiftb0y merged commit 6c47229 into mixxxdj:2.3 Mar 29, 2023
@daschuer daschuer added this to the 2.3.5 milestone Apr 14, 2023
@daschuer daschuer mentioned this pull request Apr 14, 2023
@JoergAtGithub
Copy link
Member

This PR is the root cause for #11521. If I revert these two files, I can load MP3 tracks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants