summaryrefslogtreecommitdiffstats
path: root/video/out/w32_common.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-24 23:36:40 +0100
committerwm4 <wm4@nowhere>2013-02-26 02:01:48 +0100
commit70346d3be623bc5edc31a15bd1ca205c33050219 (patch)
tree005f21e1e123cf86e6334e74213ad76479c339bb /video/out/w32_common.c
parentb23dce6d7cd66c11a770ce921659f7a19c804cf7 (diff)
downloadmpv-70346d3be623bc5edc31a15bd1ca205c33050219.tar.bz2
mpv-70346d3be623bc5edc31a15bd1ca205c33050219.tar.xz
video/out: remove video mode switching (--vm)
This allowed making the player switch the monitor video mode when creating the video window. This was a questionable feature, and with today's LCD screens certainly not useful anymore. Switching to a random video mode (going by video width/height) doesn't sound too useful either. I'm not sure about the win32 implementation, but the X part had several bugs. Even in mplayer-svn (where x11_common.c hasn't been receiving any larger changes for a long time), this code is buggy and doesn't do the right thing anyway. (And what the hell _did_ it do when using multiple physical monitors?) If you really want this, write a shell script that calls xrandr before and after calling mpv. vo_sdl still can do mode switching, because SDL has native support for it, and using it is trivial. Add a new sub-option for this.
Diffstat (limited to 'video/out/w32_common.c')
-rw-r--r--video/out/w32_common.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 54620bdec6..ca3d8a7cc5 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -388,50 +388,6 @@ static void updateScreenProperties(struct vo *vo)
w32_update_xinerama_info(vo);
}
-static void changeMode(struct vo *vo)
-{
- struct vo_w32_state *w32 = vo->w32;
- DEVMODE dm;
- dm.dmSize = sizeof dm;
- dm.dmDriverExtra = 0;
-
- dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
- dm.dmBitsPerPel = w32->depthonscreen;
- dm.dmPelsWidth = vo->opts->vo_screenwidth;
- dm.dmPelsHeight = vo->opts->vo_screenheight;
-
- if (w32->vm) {
- int bestMode = -1;
- int bestScore = INT_MAX;
- int i;
- for (i = 0; EnumDisplaySettings(0, i, &dm); ++i) {
- int score = (dm.dmPelsWidth - w32->o_dwidth)
- * (dm.dmPelsHeight - w32->o_dheight);
- if (dm.dmBitsPerPel != w32->depthonscreen
- || dm.dmPelsWidth < w32->o_dwidth
- || dm.dmPelsHeight < w32->o_dheight)
- continue;
-
- if (score < bestScore) {
- bestScore = score;
- bestMode = i;
- }
- }
-
- if (bestMode != -1)
- EnumDisplaySettings(0, bestMode, &dm);
-
- ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
- }
-}
-
-static void resetMode(struct vo *vo)
-{
- struct vo_w32_state *w32 = vo->w32;
- if (w32->vm)
- ChangeDisplaySettings(0, 0);
-}
-
static DWORD update_style(struct vo *vo, DWORD style)
{
const DWORD NO_FRAME = WS_POPUP;
@@ -465,10 +421,8 @@ static int reinit_window_state(struct vo *vo)
// xxx not sure if this can trigger any unwanted messages (WM_MOVE/WM_SIZE)
if (vo_fs) {
- changeMode(vo);
while (ShowCursor(0) >= 0) /**/ ;
} else {
- resetMode(vo);
while (ShowCursor(1) < 0) /**/ ;
}
updateScreenProperties(vo);
@@ -594,7 +548,6 @@ int vo_w32_config(struct vo *vo, uint32_t width, uint32_t height,
}
vo_fs = flags & VOFLAG_FULLSCREEN;
- w32->vm = flags & VOFLAG_MODESWITCHING;
return reinit_window_state(vo);
}
@@ -732,7 +685,6 @@ void vo_w32_uninit(struct vo *vo)
mp_msg(MSGT_VO, MSGL_V, "vo: win32: uninit\n");
if (!w32)
return;
- resetMode(vo);
ShowCursor(1);
DestroyWindow(w32->window);
UnregisterClassW(classname, 0);