Yahweasel / libav.js

This is a compilation of the libraries associated with handling audio and video in ffmpeg—libavformat, libavcodec, libavfilter, libavutil, libswresample, and libswscale—for emscripten, and thus the web.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seek in demo stops working after reaching end of file

naktinis opened this issue · comments

I loaded an MP4 file into the demo page using the "mediarecorder-transcoder" variant (which is as far as I know the only variant that loads MP4 files at the moment) and tried seeking around.

Everything works great until reaching the end of file after which an error appears saying "Error submitting the packet to the decoder: End of file" after which seeking no longer works.

This happens with every MP4 file I've tried, but I can send an example if that helps.

Is this a known issue and is there anything that can be done to work around it? Let me know if there's anything I can do to help investigate this.

demo.mp4

This is a rather silly bug. I triggered the decoder to dismantle itself on EOF, but also allowed seeking. See

res === libav.AVERROR_EOF && vIdx === vPackets.length - 1
. That's setting the fin flag, which makes sense for a normal end of file, but if you're allowing seeking after end, should not be set, as it dismantles the decoder. Will fix Soon™.