[vlc-devel] [PATCH 1/8] Add CALayer module

Pierre d'Herbemont pdherbemont at free.fr
Sat Sep 11 09:35:21 CEST 2010


On Fri, Sep 10, 2010 at 7:30 PM, David Menestrina <dmenest-vlc at ofb.net> wrote:
> On Fri, Sep 10, 2010 at 1:03 AM, Pierre d'Herbemont <pdherbemont at free.fr> wrote:
>> About the coding style, could you pick one, ie:
>>> +    if( self = [super init] )
>> and
>>> +    if (currentpic != NULL)
>
> I get to choose?  I am used to the latter, but then sometimes I
> remember the official VLC coding style is the former.  I started to go
> back and fix things up, but then I saw in another vout that the style
> was inconsistent.  Anyways, if one style is preferred over the other,
> let me know.

Use the later. The two coding style co-exists in VLC.

>>> +    if( self = [super init] )
>>> +    {
>>> +        currentpic = NULL;
>>> +        vd = p_vd;
>>> +        pthread_mutex_init(&mutex, NULL);
>>
>> NSLock?
>
> I believe the vout thread is a POSIX thread, not an NSThread.  And it
> doesn't have a runloop or an autorelease pool.  So I avoided using NS*
> stuff whereever possible.  Also, I'm a Linux guy, so I've never used
> NSLock. :)  If it is better to use NSLock here given the above
> considerations, let me know.

You don't need a NSThread, nor a runloop or an autorelease pool to use
NSLock. pthread is fine also in the end.

Pierre.



More information about the vlc-devel mailing list