Skip to content

Files less BUFFER_SIZE not playing #7

Description

@strobox

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.

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