Open ghost opened 10 years ago
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.)
So what actually means bad main_data_begin pointer
error?
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.
Listening for the
error
event when decoding an MP3 Asset often reportsbad main_data_begin pointer
orHuffman data overrun
errors. Contrary to the Asset class documentation, the decoding process finishes afterwards, apparently successfully. Errors of the typeUnderflowError
andError: 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 theerror
event, with the less fatal errors being perhaps moved to awarning
event.