+ /* search <P */
+ if( !( p = sub_SamiSearch( txt, p, "<P" ) ) )
+ {
+ return VLC_EGENERIC;
+ }
+ /* search > */
+ if( !( p = sub_SamiSearch( txt, p, ">" ) ) )
+ {
+ return VLC_EGENERIC;
+ }
+
+ i_text = 0;
+ buffer_text[0] = '\0';
+ /* now get all txt until a "Start=" line */
+ for( ;; )
+ {
+ if( *p )
+ {
+ if( *p == '<' )
+ {
+ if( !strncmp( p, "<br", 3 ) || !strncmp( p, "<BR", 3 ) )
+ {
+ ADDC( '\n' );
+ }
+ else if( strstr( p, "Start=" ) )
+ {
+ text_previous_line( txt );
+ break;
+ }
+ p = sub_SamiSearch( txt, p, ">" );
+ }
+ else if( !strncmp( p, " ", 6 ) )
+ {
+ ADDC( ' ' );
+ p += 6;
+ }
+ else if( *p == '\t' )
+ {
+ ADDC( ' ' );
+ p++;