var mp3Decode = AV.Decoder.find('mp3');
var readChunk = mp3Decode.prototype.readChunk
mp3Decode.prototype.readChunk = function () {
var sync = this.mp3_stream.sync;
var next_frame = this.mp3_stream.next_frame;
try {
return readChunk.bind(this)();
}
catch (err) {
this.mp3_stream.sync = sync;
this.mp3_stream.next_frame = next_frame;
throw err;
}
}
The above code shows how i fix the bad main_data_begin pointer issue.
The resason is because, the point (next_frame) of the mp3_stream is not reverted while catch err.
After add the code in other place, i fix that problem.
I don't know the best way to fix it, in mp3.js repository directly, so i just add the issue here.