avcodec: use a mutex instead of sem
Using a mutex instead of a sem allows avcodec callbacks to not wait for a future pf_decode and pf_flush call. The semaphore was used because ffmpeg was not thread-safe in that time. Indeed, the additional goal of the semaphore was to prevent any concurrent avcodec call. The mutex protect the pts, the p_va, the dec->fmt_out variables, the decoder_UpdateVideoFormat() and the decoder_NewPicture() call. Indeed, decoder_UpdateVideoFormat() is not reentrant and the caller should take care about serialization.
Loading