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

Saner error reporting #10

Open
ghost opened this issue Aug 8, 2014 · 3 comments
Open

Saner error reporting #10

ghost opened this issue Aug 8, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 8, 2014

Listening for the error event when decoding an MP3 Asset often reports bad main_data_begin pointer or Huffman data overrun errors. Contrary to the Asset class documentation, the decoding process finishes afterwards, apparently successfully. Errors of the type UnderflowError and Error: Invalid layer, however, are thrown as simple exceptions - and being thrown asynchronously, they are impossible for client code to catch. It'd be useful if they were reported through the error event, with the less fatal errors being perhaps moved to a warning event.

@ghost
Copy link
Author

ghost commented Sep 12, 2014

Bumping this issue in case @audiocogs didn't get a notification when I created it (my account was flagged as a robot at the time, and thus rendered invisible to other users.)

@NekR
Copy link

NekR commented Oct 22, 2015

So what actually means bad main_data_begin pointer error?

@DeusExLibris
Copy link

Answering this so that others looking for an answer might find it in the future.

The main_data_begin value is part of the "side information" of every MP3 frame. It follows the frame header (or the CRC if used) and points to the location of the data to be decoded in the bit reservoir (that is, a pointer into the data area of previous frames where the decoder should start decoding).

The "bad main_data_begin" error means that the main_data_begin pointer references a frame that doesn't exist. I have encountered it when I take a live stream and start decoding in the middle of the stream. If the bit reservoir is enabled, the main_data_begin pointer could point to frames that weren't received since they occurred before the player started.

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

No branches or pull requests

2 participants