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

MP3 2.5 files are unsupported and result in undefined behaviour #28

Closed
markozajc opened this issue Aug 13, 2023 · 0 comments · Fixed by #30
Closed

MP3 2.5 files are unsupported and result in undefined behaviour #28

markozajc opened this issue Aug 13, 2023 · 0 comments · Fixed by #30
Labels
bug Something isn't working

Comments

@markozajc
Copy link
Contributor

markozajc commented Aug 13, 2023

As a continuation of Walkyst/lavaplayer-natives-fork#6, it seems that this issue isn't caused by libmpg123 itself, but by lavaplayer incorrectly determining the MP3 parameters if the input is a MP3 2.5 file.
This results in a slew of vague and unhelpful mpg123 error messages (shown in the issue linked before).

I'm not entirely sure what it would take to implement MP3 2.5 support, but reworking this, and everything that depends on it, is probably a good start:

private static boolean isMpegVersionOne(byte[] buffer, int offset) {
return (buffer[offset + 1] & 0x08) == 0x08;
}

The above method incorrectly returns true for my sample file. Forcing it to return false doesn't solve much, because the bitrate and sample rate are still incorrectly determined.

@topi314 topi314 added the bug Something isn't working label Aug 13, 2023
This was referenced Aug 13, 2023
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