summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-10-20 21:21:42 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-10-20 21:21:42 +0000
commit4b29d38b015c189bfce66f1def81f0e22492a348 (patch)
tree42bcf42902a802a83a3e5135575d77b2f66922fb /libmpcodecs/vd_ffmpeg.c
parent74d75bf69bca4269f3fa0796112a3c6970df6cc4 (diff)
downloadmpv-4b29d38b015c189bfce66f1def81f0e22492a348.tar.bz2
mpv-4b29d38b015c189bfce66f1def81f0e22492a348.tar.xz
sample_aspect_ratio
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11195 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 48f79f353d..6f97991d28 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -383,14 +383,19 @@ static void draw_slice(struct AVCodecContext *s,
static int init_vo(sh_video_t *sh){
vd_ffmpeg_ctx *ctx = sh->context;
AVCodecContext *avctx = ctx->avctx;
+#if LIBAVCODEC_BUILD >= 4687
+ float aspect= av_q2d(avctx->sample_aspect_ratio) * avctx->width / avctx->height;
+#else
+ float aspect= avctx->aspect_ratio;
+#endif
- if (avctx->aspect_ratio != ctx->last_aspect ||
+ if ( aspect != ctx->last_aspect ||
avctx->width != sh->disp_w ||
avctx->height != sh->disp_h ||
!ctx->vo_inited)
{
- mp_msg(MSGT_DECVIDEO, MSGL_V, "[ffmpeg] aspect_ratio: %f\n", avctx->aspect_ratio);
- ctx->last_aspect = avctx->aspect_ratio;
+ mp_msg(MSGT_DECVIDEO, MSGL_V, "[ffmpeg] aspect_ratio: %f\n", aspect);
+ ctx->last_aspect = aspect;
// if(ctx->last_aspect>=0.01 && ctx->last_aspect<100)
if(sh->aspect==0.0)
sh->aspect = ctx->last_aspect;