aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-13 10:30:10 +0000
committerGravatar nick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-13 10:30:10 +0000
commitcb50547add95b09b608ff2e29fac9573a5501faf (patch)
tree9210ab99bc8e80f63e759e183915258ebb8296b5
parent696272825f842dbc8e89b62d3fdeae9dbdc391cc (diff)
test for preinit errors and correct handling subdevice
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4133 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libvo/vo_xvidix.c19
-rw-r--r--libvo/vosub_vidix.c2
2 files changed, 17 insertions, 4 deletions
diff --git a/libvo/vo_xvidix.c b/libvo/vo_xvidix.c
index 7829259ea5..4eaeab50fc 100644
--- a/libvo/vo_xvidix.c
+++ b/libvo/vo_xvidix.c
@@ -1,7 +1,7 @@
/*
VIDIX accelerated overlay in a X window
- (C) Alex Beregszaszi
+ (C) Alex Beregszaszi & Nick Kurshev
WS window manager by Pontscho/Fresh!
@@ -44,6 +44,7 @@ static int X_already_started = 0;
/* VIDIX related stuff */
static const char *vidix_name = (char *)(-1);
+static int pre_init_err = 0;
/* Image parameters */
static uint32_t image_width;
@@ -115,6 +116,11 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
XWindowAttributes attribs;
int window_depth;
+ if(pre_init_err)
+ {
+ mp_msg(MSGT_VO, MSGL_INFO, "[xvidix] Quiting due preinit error\n");
+ return -1;
+ }
// if (title)
// free(title);
title = strdup("MPlayer VIDIX X11 Overlay");
@@ -325,6 +331,10 @@ static uint32_t draw_frame(uint8_t *src[])
static uint32_t query_format(uint32_t format)
{
+ static int first = 1;
+ if(first)
+ {
+ first = 0;
if (vidix_name == (char *)(-1))
{
if (vo_subdevice)
@@ -337,9 +347,12 @@ static uint32_t query_format(uint32_t format)
}
if (vidix_preinit(vidix_name, &video_out_xvidix) != 0)
+ {
+ pre_init_err = 1;
return(0);
-
- return(vidix_query_fourcc(format));
+ }
+ }
+ return pre_init_err ? 0 : vidix_query_fourcc(format);
}
diff --git a/libvo/vosub_vidix.c b/libvo/vosub_vidix.c
index 076eede950..ad69993e9c 100644
--- a/libvo/vosub_vidix.c
+++ b/libvo/vosub_vidix.c
@@ -57,7 +57,7 @@ int vidix_preinit(const char *drvname,void *server)
return -1;
}
vidix_handler = vdlOpen("/usr/lib/mplayer/vidix/",
- drvname ? drvname[0] == ':' ? &drvname[1] : NULL : NULL,
+ drvname ? drvname[0] == ':' ? &drvname[1] : drvname[0] ? drvname : NULL : NULL,
TYPE_OUTPUT,
verbose);
if(vidix_handler == NULL)