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

Files less BUFFER_SIZE not playing #7

Open
strobox opened this issue Dec 1, 2015 · 0 comments
Open

Files less BUFFER_SIZE not playing #7

strobox opened this issue Dec 1, 2015 · 0 comments

Comments

@strobox
Copy link

strobox commented Dec 1, 2015

Files less BUFFER_SIZE not playing. That code

while (this._stream.available(BUFFER_SIZE)) {
      Ogg.HEAPU8.set(this._stream.readBuffer(BUFFER_SIZE).data, this.buf);
      Ogg._AVOggRead(this.ogg, this.buf, BUFFER_SIZE, this.callback);
    }

To get it work I've changed it to

    do {
      var toRead = BUFFER_SIZE<=this._stream.list.availableBytes?BUFFER_SIZE:this._stream.list.availableBytes;
      Ogg.HEAPU8.set(this._stream.readBuffer(toRead).data, this.buf);
      Ogg._AVOggRead(this.ogg, this.buf, toRead, this.callback);
    } while (this._stream.available(BUFFER_SIZE))

I've done it by guess, and without clear understanding what i'm doing.

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

1 participant