aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-22 14:08:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-01 19:30:06 +0200
commita0acc9eff642de0f3d247a728deb320fd4cbb75f (patch)
tree3dc2cc057890d0c22422562ce73ba899b042d832
parent4d36f7cf88ccb869c2febb50c6f42d7a722a6d4f (diff)
downloadffmpeg-a0acc9eff642de0f3d247a728deb320fd4cbb75f.tar.gz
mpeg4videoenc: guess a good aspect when we cant store the exact one.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 394781a89706479aa56749a9d69c4e74b398dd71)
-rw-r--r--libavcodec/mpegvideo_enc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index a6e9c7c7be..d13534d4f8 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -411,8 +411,10 @@ av_cold int MPV_encode_init(AVCodecContext *avctx)
if ((s->codec_id == CODEC_ID_MPEG4 || s->codec_id == CODEC_ID_H263 ||
s->codec_id == CODEC_ID_H263P) &&
(avctx->sample_aspect_ratio.num > 255 || avctx->sample_aspect_ratio.den > 255)) {
- av_log(avctx, AV_LOG_ERROR, "Invalid pixel aspect ratio %i/%i, limit is 255/255\n",
+ av_log(avctx, AV_LOG_WARNING, "Invalid pixel aspect ratio %i/%i, limit is 255/255 reducing\n",
avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den);
+ av_reduce(&avctx->sample_aspect_ratio.num, &avctx->sample_aspect_ratio.den,
+ avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 255);
return -1;
}