summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-09 22:34:11 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-09 22:56:36 +0100
commit4557d7d01fa204d0e21c5ca40604dd013b911c47 (patch)
tree2e1e7237248b987b43d67e4c2a3e6451c3e14374 /libavcodec/libx264.c
parent523da37f4c512a5bde37ab30da3d7d4e67e48c94 (diff)
libx264: workaround a bug in some versions of flash player
Fixes Ticket570 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index a31195b80d..38351e59cf 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -279,6 +279,7 @@ static int convert_pix_fmt(enum PixelFormat pix_fmt)
static av_cold int X264_init(AVCodecContext *avctx)
{
X264Context *x4 = avctx->priv_data;
+ int sw,sh;
x264_param_default(&x4->params);
@@ -507,8 +508,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.i_width = avctx->width;
x4->params.i_height = avctx->height;
- x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num;
- x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den;
+ av_reduce(&sw, &sh, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 4096);
+ x4->params.vui.i_sar_width = sw;
+ x4->params.vui.i_sar_height = sh;
x4->params.i_fps_num = x4->params.i_timebase_den = avctx->time_base.den;
x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num;