Skip to content

I have found reason why bad main_data_begin pointer happend #27

Description

@dadidzf
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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions