Because libavformat is great, and TLS libraries are great, and network
stacks are great, libavformat has some global state init functions that
do not need to be inited, and must only be run once, and also some other
global state init functions that must be deinited upon program exit,
and reinited if used again.
To this end, I've implemented this with a lock, so it can be re-inited
after deinit safely, if the user wants to do that for some reason.
NOTE: I have not updated the AviSynth plugin to use this, since I can't figure out where the hell to put the FFMS_Deinit() call, because lolexceptionsforflowcontrol.
Because libavformat is great, and TLS libraries are great, and network stacks are great, libavformat has some global state init functions that do not need to be inited, and must only be run once, and also some other global state init functions that must be deinited upon program exit, and reinited if used again.
To this end, I've implemented this with a lock, so it can be re-inited after deinit safely, if the user wants to do that for some reason.
NOTE: I have not updated the AviSynth plugin to use this, since I can't figure out where the hell to put the
FFMS_Deinit()
call, because lolexceptionsforflowcontrol.