any additional lines after 2 are merged into 2nd line
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2897
b64f7644-9d1e-0410-96f1-
a4d463321fa5
} else {
if (line == 2) {
wb->enc_buffer_used += encode_line (wb->enc_buffer+wb->enc_buffer_used,
- (unsigned char *) " ");
+ (unsigned char *) "\n");
+ line = 3;
} else {
wb->enc_buffer_used += encode_line (wb->enc_buffer+wb->enc_buffer_used,
(unsigned char *) " ");
if( *pv->current_entry.text )
{
long length;
- char *p;
+ char *p, *q;
+ int line = 1;
uint64_t start_time = ( pv->current_entry.start +
pv->subtitle->config.offset ) * 90;
uint64_t stop_time = ( pv->current_entry.stop +
length = strlen( pv->current_entry.text );
- for( p = pv->current_entry.text; *p; p++)
+ for( q = p = pv->current_entry.text; *p; p++)
{
- if( *p == '\n' || *p == '\r' )
+ if( *p == '\n' )
{
- *p = ' ';
+ if ( line == 1 )
+ {
+ *q = *p;
+ line = 2;
+ }
+ else
+ {
+ *q = ' ';
+ }
+ q++;
+ }
+ else if( *p != '\r' )
+ {
+ *q = *p;
+ q++;
+ }
+ else
+ {
+ length--;
}
}
+ *q = '\0';
buffer = hb_buffer_init( length + 1 );