Mercurial > mplayer.hg
diff libmpcodecs/vd_ffmpeg.c @ 8237:d7bc284a2b4a
aspect ratio clenaup
& a/b type aspect argument patch from (Rmi Guyomarch <rguyom at pobox dot com>)
author | michael |
---|---|
date | Wed, 20 Nov 2002 13:16:09 +0000 |
parents | 3ae71e4f2858 |
children | 1f3708389d0a |
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c Tue Nov 19 23:35:51 2002 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Wed Nov 20 13:16:09 2002 +0000 @@ -40,7 +40,7 @@ typedef struct { AVCodecContext *avctx; - int last_aspect; + float last_aspect; int do_slices; int do_dr1; int vo_inited; @@ -330,37 +330,16 @@ vd_ffmpeg_ctx *ctx = sh->context; AVCodecContext *avctx = ctx->avctx; - if (avctx->aspect_ratio_info != ctx->last_aspect || + if (avctx->aspect_ratio != ctx->last_aspect || avctx->width != sh->disp_w || avctx->height != sh->disp_h || !ctx->vo_inited) { -#if LIBAVCODEC_BUILD >= 4623 - mp_dbg(MSGT_DECVIDEO, MSGL_DBG2, "aspect_ratio_info: %d\n", avctx->aspect_ratio_info); - mp_dbg(MSGT_DECVIDEO, MSGL_DBG2, "par_width: %f\n", (float)avctx->aspected_width); - mp_dbg(MSGT_DECVIDEO, MSGL_DBG2, "par_height: %f\n", (float)avctx->aspected_height); +#if LIBAVCODEC_BUILD >= 4640 + mp_dbg(MSGT_DECVIDEO, MSGL_DBG2, "aspect_ratio: %d\n", avctx->aspect_ratio); + sh->aspect = + ctx->last_aspect = avctx->aspect_ratio; #endif - ctx->last_aspect = avctx->aspect_ratio_info; - switch(avctx->aspect_ratio_info) - { - case FF_ASPECT_4_3_625: - case FF_ASPECT_4_3_525: - sh->aspect = 4.0/3.0; - break; - case FF_ASPECT_16_9_625: - case FF_ASPECT_16_9_525: - sh->aspect = 16.0/9.0; - break; - case FF_ASPECT_SQUARE: - sh->aspect = 0.0; - break; -#if LIBAVCODEC_BUILD >= 4623 - case FF_ASPECT_EXTENDED: - if (avctx->aspected_width && avctx->aspected_height) - sh->aspect = (float)avctx->aspected_width/(float)avctx->aspected_height; - break; -#endif - } sh->disp_w = avctx->width; sh->disp_h = avctx->height; ctx->vo_inited=1;