[MPlayer-dev-eng] [PATCH] corevideo:shared_buffer broken (patch attached)

Zongyao Qu zongyao.qu at gmail.com
Wed Oct 10 13:56:33 CEST 2012


Reimar Döffinger <Reimar.Doeffinger <at> gmx.de> writes:

> Should be ok as a quick fix, but I suspect it might cause some strange
> effects if -fs is used with shared buffer.
> I think a better solution would be to set vo_screenwidth/height to some
> fallback value if they are 0.
> 

diff --git libvo/vo_corevideo.m libvo/vo_corevideo.m
index a89f25d0e218395f3c997199129646dbb720b7d2..6ef9c0193a0763
a7ef362d71e4f56ab4b4261f09 100644
--- libvo/vo_corevideo.m
+++ libvo/vo_corevideo.m
@@ -117,6 +117,16 @@ static void free_file_specific(void)
     }
 }
 
+static void update_screen_info_shared_buffer(void)
+{
+	NSRect rc = [[NSScreen mainScreen] frame];
+	vo_screenwidth = (int)rc.size.width;
+	vo_screenheight = (int)rc.size.height;
+	xinerama_x = (int)rc.origin.x;
+	xinerama_y = (int)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 @@ static int control(uint32_t request, void *data)
 		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;
 }




More information about the MPlayer-dev-eng mailing list