summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-01-27 07:21:10 +0100
committerwm4 <wm4@nowhere>2013-01-27 13:30:54 +0100
commit0535a14505c367693fe729a3f1348c4ffd516af3 (patch)
treecd22dd3c63e5f302107ff038b5998930138d4dc9 /video/out/vo_vdpau.c
parente4943165c1f1365a5c2d7b0d6924a8f65454ce20 (diff)
downloadmpv-0535a14505c367693fe729a3f1348c4ffd516af3.tar.bz2
mpv-0535a14505c367693fe729a3f1348c4ffd516af3.tar.xz
x11: reduce VO mode switching code duplication
Some parts for initiating mode switches were duplicated in every VO supporting X11 (except vo_opengl/gl_common, which didn't support mode switching). Move this to x11_common.c. Note that this might be slightly risky: is it really guaranteed that no VO needed to do "special" setup that depends on X parameters changing after a mode switch, such as bit depth, visuals etc.? From what I can see, this shouldn't be the case (X probably can't even change depth on the fly). Even if this should be a one-way road, VM switching is in general very useless, and its implementation buggy, so it can just be removed should unfixable problems arise.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 0777ec084a..00477716b7 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -178,9 +178,6 @@ struct vdpctx {
// Video equalizer
struct mp_csp_equalizer video_eq;
-
- // These tell what's been initialized and uninit() should free/uninitialize
- bool mode_switched;
};
static bool status_ok(struct vo *vo);
@@ -526,7 +523,7 @@ static int win_x11_init_vdpau_flip_queue(struct vo *vo)
"refresh rate of %.3f Hz.\n", vc->user_fps);
} else if (vc->user_fps == 0) {
#ifdef CONFIG_XF86VM
- double fps = vo_vm_get_fps(vo);
+ double fps = vo_x11_vm_get_fps(vo);
if (!fps)
mp_msg(MSGT_VO, MSGL_WARN, "[vdpau] Failed to get display FPS\n");
else {
@@ -852,10 +849,6 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
XWindowAttributes attribs;
unsigned long xswamask;
-#ifdef CONFIG_XF86VM
- int vm = flags & VOFLAG_MODESWITCHING;
-#endif
-
if (handle_preemption(vo) < 0)
return -1;
@@ -868,12 +861,6 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
if (IMGFMT_IS_VDPAU(vc->image_format) && !create_vdp_decoder(vo, 2))
return -1;
-#ifdef CONFIG_XF86VM
- if (vm) {
- vo_vm_switch(vo);
- vc->mode_switched = true;
- }
-#endif
XGetWindowAttributes(x11->display, DefaultRootWindow(x11->display),
&attribs);
XMatchVisualInfo(x11->display, x11->screen, attribs.depth, TrueColor,
@@ -889,17 +876,6 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
flags, CopyFromParent, "vdpau");
XChangeWindowAttributes(x11->display, x11->window, xswamask, &xswa);
-#ifdef CONFIG_XF86VM
- if (vm) {
- /* Grab the mouse pointer in our window */
- if (vo_grabpointer)
- XGrabPointer(x11->display, x11->window, True, 0,
- GrabModeAsync, GrabModeAsync,
- x11->window, None, CurrentTime);
- XSetInputFocus(x11->display, x11->window, RevertToNone, CurrentTime);
- }
-#endif
-
if (initialize_vdpau_objects(vo) < 0)
return -1;
@@ -1485,10 +1461,6 @@ static void uninit(struct vo *vo)
/* Destroy all vdpau objects */
destroy_vdpau_objects(vo);
-#ifdef CONFIG_XF86VM
- if (vc->mode_switched)
- vo_vm_close(vo);
-#endif
vo_x11_uninit(vo);
// Free bitstream buffers allocated by FFmpeg