aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar gpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-01-18 18:05:16 +0000
committerGravatar gpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-01-18 18:05:16 +0000
commit39cb032fd184a62416f1e62d26e05576cfd8dbe4 (patch)
treeab0c9fff5e21cdb45f6c9c32965585b67eeee82c
parentcc52547eced860feda39254c98c226ebdc6bac9d (diff)
fix device_id option after r28165
patch by Adrian Stutz %adrian A sttz P ch% Original thread: date Fri, Jan 9, 2009 at 4:03 PM subject [MPlayer-dev-eng] [PATCH] vo_macosx: fix device_id option after r28165 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28341 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--DOCS/man/en/mplayer.13
-rw-r--r--libvo/vo_macosx.m13
2 files changed, 8 insertions, 8 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 79f042d6a2..deccef7e73 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -3560,7 +3560,8 @@ Mac OS X CoreVideo video output driver
.PD 0
.RSs
.IPs device_id=<number>
-Choose the display device to use in fullscreen.
+Choose the display device to use for fullscreen or set it to \-1 to
+always use the same screen the video window is on (default: \-1 \- auto).
.IPs shared_buffer
Write output to a shared memory buffer instead of displaying it and
try to open an existing NSConnection for communication with a GUI.
diff --git a/libvo/vo_macosx.m b/libvo/vo_macosx.m
index b049cf080c..151a9fafe6 100644
--- a/libvo/vo_macosx.m
+++ b/libvo/vo_macosx.m
@@ -49,8 +49,7 @@ BOOL shared_buffer = false;
static char *buffer_name;
//Screen
-int screen_id;
-BOOL screen_force;
+int screen_id = -1;
NSRect screen_frame;
NSScreen *screen_handle;
NSArray *screen_array;
@@ -111,13 +110,13 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_
screen_array = [NSScreen screens];
if(screen_id < [screen_array count])
{
- screen_handle = [screen_array objectAtIndex:screen_id];
+ screen_handle = [screen_array objectAtIndex:(screen_id < 0 ? 0 : screen_id)];
}
else
{
mp_msg(MSGT_VO, MSGL_FATAL, "Get device error: Device ID %d do not exist, falling back to main device.\n", screen_id);
screen_handle = [screen_array objectAtIndex:0];
- screen_id = 0;
+ screen_id = -1;
}
screen_frame = [screen_handle frame];
vo_screenwidth = screen_frame.size.width;
@@ -325,7 +324,7 @@ static void uninit(void)
}
static opt_t subopts[] = {
-{"device_id", OPT_ARG_INT, &screen_id, (opt_test_f)int_non_neg},
+{"device_id", OPT_ARG_INT, &screen_id, NULL},
{"shared_buffer", OPT_ARG_BOOL, &shared_buffer, NULL},
{"buffer_name", OPT_ARG_MSTRZ,&buffer_name, NULL},
{NULL}
@@ -335,7 +334,7 @@ static int preinit(const char *arg)
{
// set defaults
- screen_id = 0;
+ screen_id = -1;
shared_buffer = false;
buffer_name = NULL;
@@ -859,7 +858,7 @@ static int control(uint32_t request, void *data, ...)
}
old_frame = [window frame]; //save main window size & position
- if(screen_force)
+ if(screen_id >= 0)
screen_frame = [screen_handle frame];
else {
screen_frame = [[window screen] frame];