summaryrefslogtreecommitdiffstats
path: root/libvo/vo_xv.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-03 05:55:02 +0200
committerwm4 <wm4@nowhere>2012-08-03 05:55:02 +0200
commitb4d9647d189a6bb924fc6b415ae18969885f11f1 (patch)
treef794e727435ef230f52dd1fac7c0f7029dc7b083 /libvo/vo_xv.c
parent11648493db7db164aa8fe01751b7e5c5e5faa810 (diff)
downloadmpv-b4d9647d189a6bb924fc6b415ae18969885f11f1.tar.bz2
mpv-b4d9647d189a6bb924fc6b415ae18969885f11f1.tar.xz
mplayer: do not create X11 state in player frontend
This is about the vo_x11_init_state() call. It basically opens a X11 connection. It's called in the main() function once. It's not really clear why this isn't done on VO creation instead. Maybe one reason was that --no-fixed-vo used to be the default: when playing a new file, the full VO state would be free'd and recreated. Keeping the X11 connection possibly improved things, although the question is how. In summary, there is no good reason to do this, and it only adds platform specific details to the player frontend. Do the X11 initialization in the respective VOs instead.
Diffstat (limited to 'libvo/vo_xv.c')
-rw-r--r--libvo/vo_xv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index df9bb69aa1..65581dac35 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -595,9 +595,13 @@ static int preinit(struct vo *vo, const char *arg)
strarg_t ck_method_arg = { 0, NULL };
struct xvctx *ctx = talloc_zero(vo, struct xvctx);
vo->priv = ctx;
- struct vo_x11_state *x11 = vo->x11;
int xv_adaptor = -1;
+ if (!vo_init(vo))
+ return -1;
+
+ struct vo_x11_state *x11 = vo->x11;
+
const opt_t subopts[] =
{
/* name arg type arg var test */
@@ -618,9 +622,6 @@ static int preinit(struct vo *vo, const char *arg)
/* modify colorkey settings according to the given options */
xv_setup_colorkeyhandling(vo, ck_method_arg.str, ck_src_arg.str);
- if (!vo_init(vo))
- return -1;
-
/* check for Xvideo extension */
unsigned int ver, rel, req, ev, err;
if (Success != XvQueryExtension(x11->display, &ver, &rel, &req, &ev, &err)) {