[vlc-devel] [PATCH v5 2/7] upnp: Add basic support for registering MediaRenderer service

Steve Lhomme robux4 at ycbcr.xyz
Tue Nov 26 09:22:00 CET 2019


Hi,

On 2019-11-26 0:18, Johan Gunnarsson wrote:
> Den mån 25 nov. 2019 kl 10:04 skrev Steve Lhomme <robux4 at ycbcr.xyz>:
>>
>>
>>
>> On 2019-11-24 23:33, Johan Gunnarsson wrote:
>>> +        }
>>> +    }
>>> +    m_mediarenderer_refcount++;
>>
>> You can move the ++ in the if() above.
> 
> If I understand you correctly, you want something like this:
> 
> if( m_mediarenderer_refcount++ == 0 ) ...
> 
> I don't like it because then I'll have to add
> m_mediarenderer_refcount-- in the error paths.

You already have to. If you fail to do initialize the thing you probably 
don't want to pretend it worked. In any case whatever way you choose, it 
doesn't change between 2 lines or 1 line.


More information about the vlc-devel mailing list