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'.