| Summary: | mpg123 doesn't store original file offset, causing seek errors when playing | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | Anthony @ POW Games <ant> |
| Component: | misc | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 2.0.4 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
Test code to reproduce the bug
test data file containing MP3 data at offset 69531 |
||
|
Description
Anthony @ POW Games
2018-12-03 12:48:04 UTC
Created attachment 3521 [details]
Test code to reproduce the bug
Created attachment 3522 [details]
test data file containing MP3 data at offset 69531
Here's the test code and a test data file containing MP3 data at offset 69531. I've found out that it's a little more complicated than mpg123 not storing the original offset because everything works if the offset is less than about 65K (there's a clue there). Once the MP3 offset is higher than about 65k, then the MP3 doesn't play. Maybe the offset is stored in, or filtered through a Uint16? Note that this test code doesn't return any errors, even if playing fails. This is a very small MP3 file for testing. In my big project there's a lot more going on and big MP3 files, and it was returning seek errors. But this test code still demonstrates the error. I tested on a data file with low offsets and it worked ok. The MP3 loads no problem, proving that the MP3 file and offset are correct. If you try to play the MP3 again and again in the main look, you can hear a quiet clicking, so something is happening. This shouldn't be limited to mp3 (mpg123): the ogg player doesn't store the original offset either. (Only mikmod player does that, I think..) I have a one-liner fix for your specific issue in the current development SDL_mixer tree, but SDL_RWsize() can be problematic (bug #5509.) Fixed as of https://hg.libsdl.org/SDL_mixer/rev/16645c8ed64a for next SDL2_mixer release. (Please confirm.) Fix also applied to SDL-1.2 branch: https://hg.libsdl.org/SDL_mixer/rev/ad8fd052d556 |