[MPlayer-cvslog] r28341 - in trunk: DOCS/man/en/mplayer.1 libvo/vo_macosx.m

gpoirier subversion at mplayerhq.hu
Sun Jan 18 19:05:16 CET 2009


Author: gpoirier
Date: Sun Jan 18 19:05:16 2009
New Revision: 28341

Log:
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

Modified:
   trunk/libvo/vo_macosx.m

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/libvo/vo_macosx.m
==============================================================================
--- trunk/libvo/vo_macosx.m	Sat Jan 17 22:33:30 2009	(r28340)
+++ trunk/libvo/vo_macosx.m	Sun Jan 18 19:05:16 2009	(r28341)
@@ -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
 	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, voi
 		}
 		
 		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];



More information about the MPlayer-cvslog mailing list