[MPlayer-cvslog] r27615 - trunk/libvo/vo_dfbmga.c
syrjala
subversion at mplayerhq.hu
Mon Sep 15 13:47:02 CEST 2008
Author: syrjala
Date: Mon Sep 15 13:47:02 2008
New Revision: 27615
Log:
Eliminate void * arithmetic.
Modified:
trunk/libvo/vo_dfbmga.c
Modified: trunk/libvo/vo_dfbmga.c
==============================================================================
--- trunk/libvo/vo_dfbmga.c (original)
+++ trunk/libvo/vo_dfbmga.c Mon Sep 15 13:47:02 2008
@@ -959,7 +959,8 @@ draw_alpha( int x0, int y0,
unsigned char *srca,
int stride )
{
- void *dst;
+ uint8_t *dst;
+ void *ptr;
int pitch;
if (use_spic) {
@@ -974,44 +975,45 @@ draw_alpha( int x0, int y0,
osd_dirty |= osd_current;
}
- if (subframe->Lock( subframe, DSLF_READ | DSLF_WRITE, &dst, &pitch ) != DFB_OK)
+ if (subframe->Lock( subframe, DSLF_READ | DSLF_WRITE, &ptr, &pitch ) != DFB_OK)
return;
+ dst = ptr;
switch (subframe_format) {
case DSPF_ALUT44:
vo_draw_alpha_alut44( w, h, src, srca, stride,
- ((uint8_t *) dst) + pitch * y0 + x0,
+ dst + pitch * y0 + x0,
pitch );
break;
case DSPF_RGB32:
case DSPF_ARGB:
vo_draw_alpha_rgb32( w, h, src, srca, stride,
- (( uint8_t *) dst) + pitch * y0 + 4 * x0,
+ dst + pitch * y0 + 4 * x0,
pitch );
break;
case DSPF_RGB24:
vo_draw_alpha_rgb24( w, h, src, srca, stride,
- ((uint8_t *) dst) + pitch * y0 + 3 * x0,
+ dst + pitch * y0 + 3 * x0,
pitch );
break;
case DSPF_RGB16:
vo_draw_alpha_rgb16( w, h, src, srca, stride,
- ((uint8_t *) dst) + pitch * y0 + 2 * x0,
+ dst + pitch * y0 + 2 * x0,
pitch );
break;
case DSPF_ARGB1555:
vo_draw_alpha_rgb15( w, h, src, srca, stride,
- ((uint8_t *) dst) + pitch * y0 + 2 * x0,
+ dst + pitch * y0 + 2 * x0,
pitch );
break;
case DSPF_YUY2:
vo_draw_alpha_yuy2( w, h, src, srca, stride,
- ((uint8_t *) dst) + pitch * y0 + 2 * x0,
+ dst + pitch * y0 + 2 * x0,
pitch );
break;
case DSPF_UYVY:
vo_draw_alpha_yuy2( w, h, src, srca, stride,
- ((uint8_t *) dst) + pitch * y0 + 2 * x0 + 1,
+ dst + pitch * y0 + 2 * x0 + 1,
pitch );
break;
#if DIRECTFBVERSION > DFB_VERSION(0,9,21)
@@ -1021,7 +1023,7 @@ draw_alpha( int x0, int y0,
case DSPF_I420:
case DSPF_YV12:
vo_draw_alpha_yv12( w, h, src, srca, stride,
- ((uint8_t *) dst) + pitch * y0 + x0,
+ dst + pitch * y0 + x0,
pitch );
break;
}
@@ -1038,11 +1040,13 @@ draw_frame( uint8_t * src[] )
static int
draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y )
{
- void *dst;
+ uint8_t *dst;
+ void *ptr;
int pitch;
- if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK)
+ if (frame->Lock( frame, DSLF_WRITE, &ptr, &pitch ) != DFB_OK)
return VO_FALSE;
+ dst = ptr;
memcpy_pic( dst + pitch * y + x, src[0],
w, h, pitch, stride[0] );
@@ -1214,7 +1218,8 @@ static uint32_t
get_image( mp_image_t *mpi )
{
int buf = current_buf;
- void *dst;
+ uint8_t *dst;
+ void *ptr;
int pitch;
if (mpi->flags & MP_IMGFLAG_READABLE &&
@@ -1237,8 +1242,9 @@ get_image( mp_image_t *mpi )
/* Always use DSLF_READ to preserve system memory copy */
if (frame->Lock( frame, DSLF_WRITE | DSLF_READ,
- &dst, &pitch ) != DFB_OK)
+ &ptr, &pitch ) != DFB_OK)
return VO_FALSE;
+ dst = ptr;
if ((mpi->width == pitch) ||
(mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) {
More information about the MPlayer-cvslog
mailing list