$OpenBSD: patch-mpeg2_video_spu_mixer_c,v 1.2 2002/06/15 23:09:34 espie Exp $
--- mpeg2_video/spu_mixer.c.orig	Sun May 26 21:32:19 2002
+++ mpeg2_video/spu_mixer.c	Sun Jun 16 00:48:18 2002
@@ -43,6 +43,8 @@
 
 
 
+int subtitle_pos[50];
+int subtitle_index = 0;
 
 #ifdef DEBUG
 #define GETBYTES(a,b) getbytes(a,b)
@@ -910,6 +912,7 @@ static void decode_display_data(spu_t *s
   y = 0;
 
   DPRINTF(5, "vlc decoding\n");
+  subtitle_index = spu_info->y_start / 64;
   while((fieldoffset[1] < spu_info->DCSQT_offset) && (y < spu_info->height)) {
     unsigned int vlc;
     unsigned int length;
@@ -985,7 +988,7 @@ static void decode_display_data(spu_t *s
       unsigned int line_y;
       char *addr;
       
-      line_y = (y + spu_info->y_start) * line_stride;
+      line_y = (y + spu_info->y_start+subtitle_pos[subtitle_index]) * line_stride;
       // (width * bpp) == line_stride (for rgb or yuv)
       addr = data + line_y + (x + spu_info->x_start) * pixel_stride;
     
