src/SDL_compat.c
changeset 2226 0e70b4b8cf84
parent 2222 926294b2bb4e
child 2228 bb67fd5ccfdb
     1.1 --- a/src/SDL_compat.c	Sat Aug 11 21:44:49 2007 +0000
     1.2 +++ b/src/SDL_compat.c	Sat Aug 11 21:51:19 2007 +0000
     1.3 @@ -1440,19 +1440,21 @@
     1.4          < 0) {
     1.5          return -1;
     1.6      }
     1.7 +    overlay->pixels[0] = (Uint8 *) pixels;
     1.8 +    overlay->pitches[0] = pitch;
     1.9      switch (overlay->format) {
    1.10      case SDL_YV12_OVERLAY:
    1.11      case SDL_IYUV_OVERLAY:
    1.12 -        overlay->pixels[0] = (Uint8 *) pixels;
    1.13 +        overlay->pitches[1] = pitch / 2;
    1.14 +        overlay->pitches[2] = pitch / 2;
    1.15          overlay->pixels[1] =
    1.16              overlay->pixels[0] + overlay->pitches[0] * overlay->h;
    1.17          overlay->pixels[2] =
    1.18 -            overlay->pixels[1] + overlay->pitches[1] * overlay->h;
    1.19 +            overlay->pixels[1] + overlay->pitches[1] * overlay->h / 2;
    1.20          break;
    1.21      case SDL_YUY2_OVERLAY:
    1.22      case SDL_UYVY_OVERLAY:
    1.23      case SDL_YVYU_OVERLAY:
    1.24 -        overlay->pixels[0] = (Uint8 *) pixels;
    1.25          break;
    1.26      }
    1.27      return 0;