[vlc-devel] [PATCH 02/11] input/subtitles: refactor subtitles_Detect

Denis Charmet typx at dinauz.org
Wed May 4 10:50:38 CEST 2016


On 2016-05-03 19:01, Thomas Guillem wrote:
> On Sat, Apr 2, 2016, at 11:31, Rémi Denis-Courmont wrote:
>> On Friday 01 April 2016 10:31:01 Thomas Guillem wrote:
>>> +
>>> +    if( p_slave0->i_priority > p_slave1->i_priority )
>>> +        return -1;
>>> +
>>> +    if( p_slave0->i_priority < p_slave1->i_priority )
>>> +        return 1;
>>> +
>>> +#ifdef HAVE_STRCOLL
>>> +    return strcoll( p_slave0->psz_uri, p_slave1->psz_uri );
>>> +#else
>>> +    return strcmp( p_slave0->psz_uri, p_slave1->psz_uri );
>>> +#endif
>> 
>> This does not make any sense to me.
> 
> I don't see why this doesn't make senses. This part of code was copied
> from subtitles.c
> 

Just because legacy code does weird stuff doesn't mean that new code 
should :)

Using the return of strcmp/strcoll only makes sense if it's zero all 
the other cases are completely arbitrary... While I agree that it's a 
"stable way" to order them it feels wrong to order them using uri 
instead of order of insertion.

Regards,
-- 
Denis Charmet - TypX
Le mauvais esprit est un art de vivre


More information about the vlc-devel mailing list