[vlc-devel] Possible Improvement

Rémi Denis-Courmont remi at remlab.net
Sat Aug 15 12:06:30 CEST 2015


Le 2015-08-11 04:20, tony a écrit :
> The file modules/demux/subtitle.c has a such line
> in ParseSubRipSubViewer:
>
> while( ( p = strstr( psz_text, "[br]" ) ) )
>
> If we change it to
>
> while( ( p = strstr( psz_text + i_old, "[br]" ) ) )
>
> ,I think there will be a performance improvement.
> Because under all circumstances,
> the content before i_old has already been searched,
> and separated by a '\n'.

True. It would be even better to continue from p - 2 after the previous 
loop iteration.

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list