aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-10 01:49:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-10 01:49:39 +0200
commitf1c0c6b7de6f236a09ba4cb82af990e90d4c17f2 (patch)
tree535260c3932ab860c0b0e17bd66a7a0b0d31d273 /ffmpeg.c
parent6a78ec180eb963a1b8b5911f8620ae1bb14a1a05 (diff)
parentde38e7c8c3dff23e24d6718c115711747cbff949 (diff)
downloadffmpeg-f1c0c6b7de6f236a09ba4cb82af990e90d4c17f2.tar.gz
Merge remote-tracking branch 'cigaes/master'
* cigaes/master: ffmpeg: use a rational for -aspect option. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 580c6556ec..71cdd2a4fc 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1072,7 +1072,7 @@ static int reap_filters(void)
switch (ost->filter->filter->inputs[0]->type) {
case AVMEDIA_TYPE_VIDEO:
filtered_frame->pts = frame_pts;
- if (!ost->frame_aspect_ratio)
+ if (!ost->frame_aspect_ratio.num)
ost->st->codec->sample_aspect_ratio = filtered_frame->sample_aspect_ratio;
do_video_out(of->ctx, ost, filtered_frame);
@@ -2312,8 +2312,8 @@ static int transcode_init(void)
codec->width = ost->filter->filter->inputs[0]->w;
codec->height = ost->filter->filter->inputs[0]->h;
codec->sample_aspect_ratio = ost->st->sample_aspect_ratio =
- ost->frame_aspect_ratio ? // overridden by the -aspect cli option
- av_d2q(ost->frame_aspect_ratio * codec->height/codec->width, 255) :
+ ost->frame_aspect_ratio.num ? // overridden by the -aspect cli option
+ av_mul_q(ost->frame_aspect_ratio, (AVRational){ codec->height, codec->width }) :
ost->filter->filter->inputs[0]->sample_aspect_ratio;
if (!strncmp(ost->enc->name, "libx264", 7) &&
codec->pix_fmt == AV_PIX_FMT_NONE &&