[vlc-devel] commit: transcode/video: fit sar-calculation (Ilkka Ollakka )
git version control
git at videolan.org
Sat Dec 26 17:42:30 CET 2009
vlc | branch: master | Ilkka Ollakka <ileoo at iki.fi> | Sat Dec 26 16:23:33 2009 +0200| [deeb788f76b62e2736dbccdc7a098fc03aa81f1d] | committer: Ilkka Ollakka
transcode/video: fit sar-calculation
Should fix aspect-ratio issues and fixes #2793
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=deeb788f76b62e2736dbccdc7a098fc03aa81f1d
---
modules/stream_out/transcode/video.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 5e3ed94..15fd25d 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -435,11 +435,15 @@ static void transcode_video_encoder_init( sout_stream_t *p_stream,
if( id->p_encoder->fmt_out.video.i_sar_num <= 0 ||
id->p_encoder->fmt_out.video.i_sar_den <= 0 )
{
- id->p_encoder->fmt_out.video.i_sar_num =
- f_aspect * id->p_encoder->fmt_out.video.i_height + 0.5;
- id->p_encoder->fmt_out.video.i_sar_num =
- VOUT_ASPECT_FACTOR * id->p_encoder->fmt_out.video.i_width;
+ id->p_encoder->fmt_out.video.i_sar_num = id->p_decoder->fmt_out.video.i_sar_num * i_src_width / i_dst_width;
+ id->p_encoder->fmt_out.video.i_sar_den = id->p_decoder->fmt_out.video.i_sar_den * i_src_height / i_dst_height;
}
+ vlc_ureduce( &id->p_encoder->fmt_out.video.i_sar_num,
+ &id->p_encoder->fmt_out.video.i_sar_den,
+ id->p_encoder->fmt_out.video.i_sar_num,
+ id->p_encoder->fmt_out.video.i_sar_den,
+ 0 );
+
id->p_encoder->fmt_in.video.i_sar_num =
id->p_encoder->fmt_out.video.i_sar_num;
id->p_encoder->fmt_in.video.i_sar_den =
More information about the vlc-devel
mailing list