# HG changeset patch # User reimar # Date 1337801283 0 # Node ID c5f89bf5b952fef4de060cf06e0bff5326389850 # Parent 444a6a469743eb3dfc083f80857d531b04887e6b corevideo: Reduce code duplication in OSD rendering code. diff -r 444a6a469743 -r c5f89bf5b952 libvo/vo_corevideo.m --- a/libvo/vo_corevideo.m Wed May 23 19:17:30 2012 +0000 +++ b/libvo/vo_corevideo.m Wed May 23 19:28:03 2012 +0000 @@ -99,17 +99,19 @@ 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; } }