Commit 39f890d2 authored by Gildas Bazin's avatar Gildas Bazin

* src/video_output/vout_intf.c, src/misc/image.c: proper aspect ratio for snapshots.

parent 21127514
......@@ -581,6 +581,15 @@ static encoder_t *CreateEncoder( vlc_object_t *p_this, video_format_t *fmt_in,
p_enc->fmt_in.video.i_width = fmt_out->i_width;
p_enc->fmt_in.video.i_height = fmt_out->i_height;
}
else if( fmt_out->i_sar_num && fmt_out->i_sar_den &&
fmt_out->i_sar_num * fmt_in->i_sar_den !=
fmt_out->i_sar_den * fmt_in->i_sar_num )
{
p_enc->fmt_in.video.i_width =
fmt_in->i_sar_num * (int64_t)fmt_out->i_sar_den * fmt_in->i_width /
fmt_in->i_sar_den / fmt_out->i_sar_num;
}
p_enc->fmt_in.video.i_frame_rate = 25;
p_enc->fmt_in.video.i_frame_rate_base = 1;
......
......@@ -356,6 +356,9 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
fmt_in.i_chroma = p_vout->render.i_chroma;
fmt_in.i_width = p_vout->render.i_width;
fmt_in.i_height = p_vout->render.i_height;
fmt_in.i_sar_num = p_vout->fmt_render.i_sar_num;
fmt_in.i_sar_den = p_vout->fmt_render.i_sar_den;
fmt_out.i_sar_num = fmt_out.i_sar_den = 1;
i_ret = image_WriteUrl( p_image, p_pic, &fmt_in, &fmt_out, psz_filename );
if( i_ret != VLC_SUCCESS )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment