[MPlayer-cvslog] r34964 - trunk/libvo/vo_corevideo.m

reimar subversion at mplayerhq.hu
Wed May 23 21:28:03 CEST 2012


Author: reimar
Date: Wed May 23 21:28:03 2012
New Revision: 34964

Log:
corevideo: Reduce code duplication in OSD rendering code.

Modified:
   trunk/libvo/vo_corevideo.m

Modified: trunk/libvo/vo_corevideo.m
==============================================================================
--- trunk/libvo/vo_corevideo.m	Wed May 23 21:17:30 2012	(r34963)
+++ trunk/libvo/vo_corevideo.m	Wed May 23 21:28:03 2012	(r34964)
@@ -99,17 +99,19 @@ LIBVO_EXTERN(corevideo)
 
 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride)
 {
+	unsigned char *dst = image_data + image_bytes * (y0 * image_width + x0);
+	int dststride = image_bytes * image_width;
 	switch (image_format)
 	{
 		case IMGFMT_RGB24:
-			vo_draw_alpha_rgb24(w,h,src,srca,stride,image_data+3*(y0*image_width+x0),3*image_width);
+			vo_draw_alpha_rgb24(w,h,src,srca,stride,dst,dststride);
 			break;
 		case IMGFMT_ARGB:
 		case IMGFMT_BGRA:
-			vo_draw_alpha_rgb32(w,h,src,srca,stride,image_data+4*(y0*image_width+x0),4*image_width);
+			vo_draw_alpha_rgb32(w,h,src,srca,stride,dst,dststride);
 			break;
 		case IMGFMT_YUY2:
-			vo_draw_alpha_yuy2(w,h,src,srca,stride,image_data + (x0 + y0 * image_width) * 2,image_width*2);
+			vo_draw_alpha_yuy2(w,h,src,srca,stride,dst,dststride);
 			break;
 	}
 }


More information about the MPlayer-cvslog mailing list