[vlc-devel] [PATCH 2/2] avcodec: protect the flush call
Steve Lhomme
robux4 at ycbcr.xyz
Tue Sep 24 09:41:19 CEST 2019
On 2019-09-23 18:25, Rémi Denis-Courmont wrote:
> Hi,
>
> I don't know exactly what synchronisation was needed then and now for avcodec per se, as opposed to what Laurent did for old VLC core or just out of uncertainty.
>
> But there is one difference between a semaphore lock and a mutex lock. The earlier can be released from a different thread than the one which acquired it. The splitter uses semaphores for that reason: it cannot assume that the releasing thread is the acquiring thread.
I think in the case of lavc it's only used to protect some variables
between the lavc decoder thread(s) and VLC decoder/input thread, not to
adjust the order in which threads are allowed to run.
> Le 23 septembre 2019 13:49:14 GMT+03:00, Francois Cartegnie <fcvlcdev at free.fr> a écrit :
>> 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 ?
>>
>> --
>> Francois Cartegnie
>> VideoLAN - VLC Developer
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
>
>
> _______________________________________________
> 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