From 4aff125b35984e7777d06edccdceeb28e531b907 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 20 Nov 2009 23:15:11 +0200 Subject: [PATCH] VO: Keep aspect by adding black bars in window mode too if necessary By default (without -nokeepaspect) MPlayer tries to maintain video aspect ratio by using window manager hints to keep output window aspect when resizing. Before this commit it would however scale the video to completely fill the window even if the window manager did not respect those hints. Change the behavior to add black bars like in fullscreen mode instead in this case. --- DOCS/man/en/mplayer.1 | 8 ++++++-- libvo/video_out.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 1a851be78b..083e7363fb 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3172,8 +3172,12 @@ Useful for multihead setups. .TP .B \-nokeepaspect Do not keep window aspect ratio when resizing windows. -Only works with the x11, xv, xmga, xvidix, directx video output drivers. -Furthermore under X11 your window manager has to honor window aspect hints. +By default MPlayer tries to keep the correct video aspect ratio by +instructing the window manager to maintain window aspect when resizing, +and by adding black bars if the window manager nevertheless allows +window shape to change. +This option disables window manager aspect hints and scales the video +to completely fill the window without regard for aspect ratio. . .TP .B "\-ontop\ " diff --git a/libvo/video_out.h b/libvo/video_out.h index 7211d69e65..9331e80faf 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -347,7 +347,7 @@ void calc_src_dst_rects(struct vo *vo, int src_width, int src_height, static inline int aspect_scaling(void) { - return vo_fs; + return vo_keepaspect || vo_fs; } #endif /* MPLAYER_VIDEO_OUT_H */