[vlc-devel] [PATCH] omxil: Add reference counting around the OMX Core loading and initialization

Martin Storsjö martin at martin.st
Sun Oct 2 21:40:46 CEST 2011


On Sun, 2 Oct 2011, Rémi Denis-Courmont wrote:

> Le dimanche 2 octobre 2011 22:07:25 Martin Storsjö, vous avez écrit :
>> This avoids deinitializing the global OMX Core if a second
>> instance of the module is initialized (e.g. for testing whether
>> it can handle decoding another stream) and deinitialized while
>> the first instance still is active.
>
> Do you really need two reference counters?

It felt clearer initially, but the only case where they'd differ is for 
the first initialization, if the OMX_Init() function fails. Reworked it to 
use only one counter.

> In any case, they should be unsigned. I would also rather the reference
> counters be _explicitly_ initialized to 0. I know the C standard requires it
> implicitly, but it is ugly :-)

Ok, if you prefer it that way, I'll change it.

// Martin


More information about the vlc-devel mailing list