summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-07-28 17:07:49 +0200
committerwm4 <wm4@mplayer2.org>2012-07-28 17:24:05 +0200
commit51e198c2a1e43b74ad35ef358628dcd8791158d9 (patch)
tree60f6c2255ed912a7a4866b71728104a2cb2442f1 /libmpcodecs/vd.c
parent2793e7eb70a342b346788f83e1ed660c8e0d491e (diff)
parent7dfaaa95104a8e6dc024fddaf1b49c71768f1be7 (diff)
downloadmpv-51e198c2a1e43b74ad35ef358628dcd8791158d9.tar.bz2
mpv-51e198c2a1e43b74ad35ef358628dcd8791158d9.tar.xz
Merge remote-tracking branch 'origin/master'
Conflicts: .gitignore bstr.c cfg-mplayer.h defaultopts.c libvo/video_out.c The conflict in bstr.c is due to uau adding a bstr_getline function in commit 2ba8b91a97e7e8. This function already existed in this branch. While uau's function is obviously derived from mine, it's incompatible. His function preserves line breaks, while mine strips them. Add a bstr_strip_linebreaks function, fix all other uses of bstr_getline, and pick uau's implementation. In .gitignore, change vo_gl3_shaders.h to use an absolute path additional to resolving the merge conflict.
Diffstat (limited to 'libmpcodecs/vd.c')
-rw-r--r--libmpcodecs/vd.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c
index e6ce3e8ff3..e756c2d53e 100644
--- a/libmpcodecs/vd.c
+++ b/libmpcodecs/vd.c
@@ -125,6 +125,11 @@ int mpcodecs_config_vo2(sh_video_t *sh, int w, int h,
if (h)
sh->disp_h = h;
+ mp_msg(MSGT_DECVIDEO, MSGL_INFO,
+ "VIDEO: %dx%d %5.3f fps %5.1f kbps (%4.1f kB/s)\n",
+ sh->disp_w, sh->disp_h, sh->fps, sh->i_bps * 0.008,
+ sh->i_bps / 1000.0);
+
if (!sh->disp_w || !sh->disp_h)
return 0;
@@ -293,22 +298,23 @@ int mpcodecs_config_vo2(sh_video_t *sh, int w, int h,
}
}
if (sh->aspect > 0.01) {
- int w;
- mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Movie-Aspect is %.2f:1 - prescaling to correct movie aspect.\n",
- sh->aspect);
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_ASPECT=%1.4f\n",
sh->aspect);
- w = (int) ((float) screen_size_y * sh->aspect);
- w += w % 2; // round
+ int w = screen_size_y * sh->aspect;
+ int h = screen_size_y;
// we don't like horizontal downscale || user forced width:
if (w < screen_size_x || opts->screen_size_xy > 8) {
- screen_size_y =
- (int) ((float) screen_size_x * (1.0 / sh->aspect));
- screen_size_y += screen_size_y % 2; // round
- } else
- screen_size_x = w; // keep new width
+ w = screen_size_x;
+ h = screen_size_x / sh->aspect;
+ }
+ if (abs(screen_size_x - w) >= 4 || abs(screen_size_y - h) >= 4) {
+ screen_size_x = w;
+ screen_size_y = h;
+ mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Aspect ratio is %.2f:1 - "
+ "scaling to correct movie aspect.\n", sh->aspect);
+ }
} else {
- mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Movie-Aspect is undefined - no prescaling applied.\n");
+ mp_tmsg(MSGT_CPLAYER, MSGL_V, "Movie-Aspect is undefined - no prescaling applied.\n");
}
}