changeset 35150:4683218a0324

vo corevideo: VOCTRL_UPDATE_SCREENINFO: Fix shared_buffer case Do not just perform a NOP and then return VO_TRUE indicating success. Instead set common vo variables and call aspect_save_screenres. Patch by Zongyao Qu >zongyao.qu gmail.com<
author al
date Fri, 12 Oct 2012 21:21:07 +0000
parents fbe4b3716aa0
children 13a97c60f6d8
files libvo/vo_corevideo.m
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_corevideo.m	Thu Oct 11 22:10:48 2012 +0000
+++ b/libvo/vo_corevideo.m	Fri Oct 12 21:21:07 2012 +0000
@@ -117,6 +117,16 @@
     }
 }
 
+static void update_screen_info_shared_buffer(void)
+{
+	NSRect rc = [[NSScreen mainScreen] frame];
+	vo_screenwidth  = rc.size.width;
+	vo_screenheight = rc.size.height;
+	xinerama_x = rc.origin.x;
+	xinerama_y = rc.origin.y;
+	aspect_save_screenres(vo_screenwidth, vo_screenheight);
+}
+
 static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
 {
 	free_file_specific();
@@ -390,7 +400,12 @@
 		case VOCTRL_FULLSCREEN: vo_fs = !vo_fs; if(!shared_buffer){ [mpGLView fullscreen: NO]; } else { [mplayerosxProto toggleFullscreen]; } return VO_TRUE;
 		case VOCTRL_GET_PANSCAN: return VO_TRUE;
 		case VOCTRL_SET_PANSCAN: panscan_calc(); return VO_TRUE;
-		case VOCTRL_UPDATE_SCREENINFO: [mpGLView update_screen_info]; return VO_TRUE;
+		case VOCTRL_UPDATE_SCREENINFO:
+			if (shared_buffer)
+				update_screen_info_shared_buffer();
+			else
+				[mpGLView update_screen_info];
+			return VO_TRUE;
 	}
 	return VO_NOTIMPL;
 }