gpac / mp4box.js

JavaScript version of GPAC's MP4Box tool
https://gpac.github.io/mp4box.js/
BSD 3-Clause "New" or "Revised" License
1.94k stars 326 forks source link

fix: set next seek position if sample data is missing for extracted tracks samples #295

Closed lideen closed 1 year ago

lideen commented 1 year ago

I found a problem with sample extraction: nextSeekPosition was never updated when samples were missing from buffers. This causes onSamples to not be called if the data is not already in the buffers as appendBuffer would never return the offset required for the sample extraction track.

I tried to fix it with this change, feel free to make changes / suggest a better solution.

RobbieFernandez commented 1 year ago

Thank you! I was having issues with the video stalling whenever I seeked back to an unbuffered period of the video stream and this solves it wonderfully!