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.
288 stars 18 forks source link

Bugfix/js functions use single pointer options #36

Closed reinhrst closed 7 months ago

reinhrst commented 7 months ago

As discussed in #34 , this PR patches both av_dict_set_js and avio_open2_js to accept a AVDictionary* rather than a AVDictionary ** (since the JS code only exposed AVDictionary*).

Note that this does mean that av_dict_set_js will not be able to return a list of unused options (as ffmpeg's av_dict_set does).

I changed the 500-demuxer-decode test to include some arbitrary options dictionary. This test will fail without the code change, since free will be called on something that is not a pointer.

Yahweasel commented 7 months ago

I really can't thank you enough for finding these things. This is a corner of the types that I'd never really fought, so never really tested. I'll review these changes later today.

By the way, I believe that in one of these earlier interactions you mentioned that you were doing something with HLS, so if you didn't notice, you may want to know that I added HLS support directly to libav.js. For the tests I've done it works great, but it's also not in the test suite, since that requires external stuff to test correctly ^^´. You can find info on it in IO.md.

reinhrst commented 7 months ago

No worried, happy I can contribute to this amazing project :)

I was not the person asking about HLS -- I'm only trying to read/write to/from FileSystemFileHandles (for now). Still, good reminder to check what is new in 4.6.6 (I like commits called "Switched to a much more robust dependencies system" :)).