unsigned int i_bits_per_pixel; /**< number of bits per pixel */
+ unsigned int i_sar_num; /**< sample/pixel aspect ratio */
+ unsigned int i_sar_den;
+
unsigned int i_frame_rate; /**< frame rate numerator */
unsigned int i_frame_rate_base; /**< frame rate denominator */
else
p_fmt = &id->p_decoder->fmt_out.video;
+ /* FIXME (shouldn't have to be done here) */
+ p_fmt->i_sar_num = p_fmt->i_aspect *
+ p_fmt->i_height / p_fmt->i_width;
+ p_fmt->i_sar_den = VOUT_ASPECT_FACTOR;
+
spu_RenderSubpictures( p_sys->p_spu, p_fmt, p_pic, p_pic, p_subpic,
i_scale_width, i_scale_height );
}
memset( &fmt, 0, sizeof(video_format_t) );
fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
fmt.i_aspect = VOUT_ASPECT_FACTOR;
+ fmt.i_sar_num = fmt.i_sar_den = 1;
fmt.i_width = fmt.i_visible_width = p_sys->i_width;
fmt.i_height = fmt.i_visible_height = p_sys->i_height;
fmt.i_x_offset = fmt.i_y_offset = 0;
add_integer ( "x11-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, VLC_TRUE );
#endif
set_description( _("X11 video output") );
- set_capability( "video output", 50 );
+ set_capability( "video output", 70 );
set_callbacks( E_(Activate), E_(Deactivate) );
vlc_module_end();
fmt.i_chroma = p_vout->output.i_chroma;
fmt.i_width = p_vout->output.i_width;
fmt.i_height = p_vout->output.i_height;
+ fmt.i_sar_num = p_vout->output.i_aspect * fmt.i_height / fmt.i_width;
+ fmt.i_sar_den = VOUT_ASPECT_FACTOR;
i_scale_width = p_vout->output.i_width * 1000 / p_vout->render.i_width;
i_scale_height = p_vout->output.i_height * 1000 / p_vout->render.i_height;
p_subpic->i_original_picture_height;
}
+ /* Take care of the aspect ratio */
+ if( p_region && p_region->fmt.i_sar_num * p_fmt->i_sar_den !=
+ p_region->fmt.i_sar_den * p_fmt->i_sar_num )
+ {
+ i_scale_width = i_scale_width *
+ (int64_t)p_region->fmt.i_sar_num * p_fmt->i_sar_den /
+ p_region->fmt.i_sar_den / p_fmt->i_sar_num;
+ }
+
/* Load the scaling module */
if( !p_spu->p_scale && (i_scale_width != 1000 ||
i_scale_height != 1000) )