p_spu->i_stop = p_block->i_pts + p_block->i_length;
p_spu->b_ephemer = (p_block->i_length == 0);
p_spu->b_absolute = VLC_FALSE;
+ p_spu->i_original_picture_width = p_sys->i_original_width;
+ p_spu->i_original_picture_height = p_sys->i_original_height;
if( psz_subtitle ) free( psz_subtitle );
}
return p_spu;
if( psz_parser[0] == '!' || psz_parser[0] == ';' ) /* comment */;
else if( sscanf( psz_parser, "PlayResX: %d", &temp ) == 1 )
- p_sys->i_original_width = temp;
+ p_sys->i_original_width = ( temp > 0 ) ? temp : -1;
else if( sscanf( psz_parser, "PlayResY: %d", &temp ) == 1 )
- p_sys->i_original_height = temp;
+ p_sys->i_original_height = ( temp > 0 ) ? temp : -1;
else if( sscanf( psz_parser, "Script Type: %8192s", buffer_text ) == 1 )
{
if( !strcasecmp( buffer_text, "V4.00+" ) ) p_sys->b_ass = VLC_TRUE;
i_scale_width = i_scale_width_orig;
i_scale_height = i_scale_height_orig;
- if( p_subpic->i_original_picture_width &&
- p_subpic->i_original_picture_height )
+ if( p_subpic->i_original_picture_height > 0 &&
+ p_subpic->i_original_picture_width > 0 )
{
i_scale_width = i_scale_width * p_fmt->i_width /
p_subpic->i_original_picture_width;
i_scale_height = i_scale_height * p_fmt->i_height /
p_subpic->i_original_picture_height;
}
+ else if( p_subpic->i_original_picture_height > 0 )
+ {
+ i_scale_height = i_scale_height * p_fmt->i_height /
+ p_subpic->i_original_picture_height;
+ i_scale_width = i_scale_height * i_scale_height / p_fmt->i_height;
+ }
/* Set default subpicture aspect ratio */
if( p_region && p_region->fmt.i_aspect &&