[vlc-devel] [PATCH 2/2] avcodec: protect the flush call
Thomas Guillem
thomas at gllm.fr
Mon Sep 23 13:56:03 CEST 2019
On Mon, Sep 23, 2019, at 13:17, Steve Lhomme wrote:
> On 2019-09-23 12:49, Francois Cartegnie wrote:
> > Le 23/09/2019 à 10:51, Thomas Guillem a écrit :
> >> It's just a 0/1 semaphore. I don't really know why we use a semaphore here instead of a mutex.
> >>
> >
> > Dates from early avcodec threading.
> > The usual comment is : is that still needed ?
>
> Good question. The main use I see is protecting resources between the
> decoder thread(s) (may not be needed if lavc is guaranteed not to
> request buffers concurrently, which would make sense) and the
> input/decoder thread (which is probably still needed).
Actually, it does more than a simple mutex.
The callbacks from avcodec ( lavc_GetFrame, ffmpeg_GetFormat) can only be waken up while pf_decode or pf_flush are called.
So this is not a truly asynchronous decoder module. For the record, there was not asynchronous decoder when this was done. It could be greatly improved today. Avcodec codecs should not wait for the DecoderThread to unblock now.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list