- if( p_region->fmt.i_chroma != VLC_FOURCC('T','E','X','T') )
- {
- /* */
- SpuRenderUpdateBlend( p_spu, &p_region->fmt );
-
- /* Force cropping if requested */
- if( p_spu->b_force_crop )
- {
- video_format_t *p_fmt = &p_spu->p_blend->fmt_in.video;
- int i_crop_x = p_spu->i_crop_x * pi_scale_width[ i_scale_idx ] / 1000
- * i_inv_scale_x / 1000;
- int i_crop_y = p_spu->i_crop_y * pi_scale_height[ i_scale_idx ] / 1000
- * i_inv_scale_y / 1000;
- int i_crop_width = p_spu->i_crop_width * pi_scale_width[ i_scale_idx ] / 1000
- * i_inv_scale_x / 1000;
- int i_crop_height = p_spu->i_crop_height * pi_scale_height[ i_scale_idx ] / 1000
- * i_inv_scale_y / 1000;
-
- /* Find the intersection */
- if( i_crop_x + i_crop_width <= i_x_offset ||
- i_x_offset + (int)p_fmt->i_visible_width < i_crop_x ||
- i_crop_y + i_crop_height <= i_y_offset ||
- i_y_offset + (int)p_fmt->i_visible_height < i_crop_y )
- {
- /* No intersection */
- p_fmt->i_visible_width = p_fmt->i_visible_height = 0;
- }
- else
- {
- int i_x, i_y, i_x_end, i_y_end;
- i_x = __MAX( i_crop_x, i_x_offset );
- i_y = __MAX( i_crop_y, i_y_offset );
- i_x_end = __MIN( i_crop_x + i_crop_width,
- i_x_offset + (int)p_fmt->i_visible_width );
- i_y_end = __MIN( i_crop_y + i_crop_height,
- i_y_offset + (int)p_fmt->i_visible_height );
-
- p_fmt->i_x_offset = i_x - i_x_offset;
- p_fmt->i_y_offset = i_y - i_y_offset;
- p_fmt->i_visible_width = i_x_end - i_x;
- p_fmt->i_visible_height = i_y_end - i_y;
-
- i_x_offset = i_x;
- i_y_offset = i_y;
- }
- }
-
- i_x_offset = __MAX( i_x_offset, 0 );
- i_y_offset = __MAX( i_y_offset, 0 );
-
- /* Update the output picture size */
- p_spu->p_blend->fmt_out.video.i_width =
- p_spu->p_blend->fmt_out.video.i_visible_width =
- p_fmt->i_width;
- p_spu->p_blend->fmt_out.video.i_height =
- p_spu->p_blend->fmt_out.video.i_visible_height =
- p_fmt->i_height;