[FFmpeg-devel] [PATCH] change frame_aspect_ratio to AVRational

Michael Niedermayer michaelni
Thu Jun 11 13:27:26 CEST 2009


On Wed, Jun 10, 2009 at 09:23:40PM -0700, Baptiste Coudurier wrote:
> Hi
> 
> $subject, mainly to avoid using double which behaves not correctly
> when using 16:9 commandline.
[...]
> @@ -3012,7 +3012,8 @@
>          st->stream_copy = 1;
>          video_enc->codec_type = CODEC_TYPE_VIDEO;
>          video_enc->sample_aspect_ratio =
> -        st->sample_aspect_ratio = av_d2q(frame_aspect_ratio*frame_height/frame_width, 255);
> +        st->sample_aspect_ratio =
> +            av_mul_q(frame_aspect_ratio, (AVRational){ frame_height, frame_width });
>      } else {
>          const char *p;
>          int i;
> @@ -3039,7 +3040,8 @@
>  
>          video_enc->width = frame_width + frame_padright + frame_padleft;
>          video_enc->height = frame_height + frame_padtop + frame_padbottom;
> -        video_enc->sample_aspect_ratio = av_d2q(frame_aspect_ratio*video_enc->height/video_enc->width, 255);
> +        video_enc->sample_aspect_ratio =
> +            av_mul_q(frame_aspect_ratio, (AVRational){ frame_height, frame_width });
>          video_enc->pix_fmt = frame_pix_fmt;
>          st->sample_aspect_ratio = video_enc->sample_aspect_ratio;
>  

previously these where limited to 255/255 now they arent anymore, i think
some codecs dont support arbitrary fractions

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090611/6ace73b4/attachment.pgp>



More information about the ffmpeg-devel mailing list