diff options
author | wm4 <wm4@nowhere> | 2013-09-26 16:53:17 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-09-26 17:29:14 +0200 |
commit | 9a55c4e70cebe6da6b7c7796119f84c4c9ad2a60 (patch) | |
tree | 2b998cc92f0b0d091cc48051cb3cfebff8370837 /video/decode/vd.c | |
parent | f5bf6c0fb33fb6ff11f3250de708eb6e658772c9 (diff) | |
download | mpv-9a55c4e70cebe6da6b7c7796119f84c4c9ad2a60.tar.bz2 mpv-9a55c4e70cebe6da6b7c7796119f84c4c9ad2a60.tar.xz |
video: let sh_video->aspect always be container aspect ratio
Now writing -1 to the 'aspect' property resets the video to the auto
aspect ratio. Returning the aspect from the property becomes a bit more
complicated, because we still try to return the container aspect ratio
if no frame has been decoded yet.
Diffstat (limited to 'video/decode/vd.c')
-rw-r--r-- | video/decode/vd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/video/decode/vd.c b/video/decode/vd.c index ad2af3a2cd..574f0468d4 100644 --- a/video/decode/vd.c +++ b/video/decode/vd.c @@ -115,12 +115,13 @@ int mpcodecs_reconfig_vo(sh_video_t *sh, const struct mp_image_params *params) } // time to do aspect ratio corrections... - if (opts->movie_aspect > -1.0) - sh->aspect = opts->movie_aspect; // cmdline overrides autodetect - else if (sh->stream_aspect != 0.0) - sh->aspect = sh->stream_aspect; + float force_aspect = opts->movie_aspect; + if (force_aspect > -1.0 && sh->stream_aspect != 0.0) + force_aspect = sh->stream_aspect; + + if (force_aspect >= 0) + vf_set_dar(&p.d_w, &p.d_h, p.w, p.h, force_aspect); - vf_set_dar(&p.d_w, &p.d_h, p.w, p.h, sh->aspect); if (abs(p.d_w - p.w) >= 4 || abs(p.d_h - p.h) >= 4) { mp_tmsg(MSGT_CPLAYER, MSGL_V, "Aspect ratio is %.2f:1 - " "scaling to correct movie aspect.\n", sh->aspect); |