[MPlayer-cvslog] r36401 - trunk/libmpcodecs/vd.c
Ingo Brückl
ib at wupperonline.de
Tue Aug 6 14:51:20 CEST 2013
I wrote on Mon, 05 Aug 2013 17:59:31 +0200:
> Index: libmpcodecs/vd_ffmpeg.c
> ===================================================================
> // Do not overwrite s->aspect on the first call, so that a container
> // aspect if available is preferred.
> // But set it even if the sample aspect did not change, since a
> // resolution change can cause an aspect change even if the
> // _sample_ aspect is unchanged.
> if (sh->aspect == 0 || ctx->last_sample_aspect_ratio.den)
> - sh->aspect = aspect;
> + sh->original_aspect = aspect;
> ctx->last_sample_aspect_ratio = avctx->sample_aspect_ratio;
I had problems associating the comment with the condition, but after trying
to roughly understand vd_ffmpeg, I'd say that the usage of sh->aspect in the
condition is probably wrong, and the patch should be:
Index: libmpcodecs/vd_ffmpeg.c
===================================================================
--- libmpcodecs/vd_ffmpeg.c (revision 36406)
+++ libmpcodecs/vd_ffmpeg.c (working copy)
@@ -510,13 +510,13 @@
set_format_params(avctx, pix_fmt);
mp_msg(MSGT_DECVIDEO, MSGL_V, "[ffmpeg] aspect_ratio: %f\n", aspect);
- // Do not overwrite s->aspect on the first call, so that a container
- // aspect if available is preferred.
+ // Do not overwrite sh->original_aspect on the first call,
+ // if a container aspect is available (which is preferred then).
// But set it even if the sample aspect did not change, since a
// resolution change can cause an aspect change even if the
// _sample_ aspect is unchanged.
- if (sh->aspect == 0 || ctx->last_sample_aspect_ratio.den)
- sh->aspect = aspect;
+ if (sh->original_aspect == 0 || ctx->last_sample_aspect_ratio.den)
+ sh->original_aspect = aspect;
ctx->last_sample_aspect_ratio = avctx->sample_aspect_ratio;
ctx->pix_fmt = pix_fmt;
ctx->best_csp = pixfmt2imgfmt(pix_fmt);
No idea whether the comment is easier to understand now.
Ingo
More information about the MPlayer-cvslog
mailing list