[FFmpeg-devel] default lock mechanism in libavcodec/utils.c
anshul.ffmpeg at gmail.com
Wed Jan 29 07:19:41 CET 2014
On 01/29/2014 11:11 AM, anshul wrote:
> On 01/28/2014 08:31 PM, Michael Niedermayer wrote:
>> if you had avcodec_unregister_all() you will have to deal with
>> libgstreamer and libvlc calling it while your app is also
>> calling it and maybe another lib calling register and yet another
>> still using avcodec. all happening at the same time
>> this can be solved in various ways, a lock and reference counting is
>> one, another is to use some code that gets called on exit or
>> lib unloading by the OS.
>> I think none of these will be really easy to do portably
> If I am planning to use some code that gets called when library is
> I do need static avcodec lock acess out of library, I have attached
> one patch
> so that user might be able to call this function in his destructor of
> But your idea about reference count is very good, but I don't where to
> keep that
> reference count variable, only thing that strike my mind was to make
> reference count variable global.
> If you have any other way then making it global please ...
forgot to add return 0; my new patch with same thing
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1273 bytes
Desc: not available
More information about the ffmpeg-devel