[MPlayer-cvslog] r30630 - trunk/libmpcodecs/vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Thu Feb 18 00:46:57 CET 2010


Author: reimar
Date: Thu Feb 18 00:46:57 2010
New Revision: 30630

Log:
Handle negative height in draw_slice from FFmpeg in vd_ffmpeg.c, since at
least vo_xv and vo_sdl can not handle it and the scale filter seems
to work fine either way.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Thu Feb 18 00:45:01 2010	(r30629)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Thu Feb 18 00:46:57 2010	(r30630)
@@ -480,6 +480,7 @@ static void draw_slice(struct AVCodecCon
                         int y, int type, int height){
     sh_video_t *sh = s->opaque;
     uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]};
+    int strides[MP_MAX_PLANES] = {src->linesize[0], src->linesize[1], src->linesize[2]};
 #if 0
     int start=0, i;
     int width= s->width;
@@ -502,8 +503,19 @@ static void draw_slice(struct AVCodecCon
         }
     }else
 #endif
+    if (height < 0)
+    {
+        int i;
+        height = -height;
+        y -= height;
+        for (i = 0; i < MP_MAX_PLANES; i++)
+        {
+            strides[i] = -strides[i];
+            source[i] -= strides[i];
+        }
+    }
     if (y < sh->disp_h) {
-        mpcodecs_draw_slice (sh, source, src->linesize, sh->disp_w, (y+height)<=sh->disp_h?height:sh->disp_h-y, 0, y);
+        mpcodecs_draw_slice (sh, source, strides, sh->disp_w, (y+height)<=sh->disp_h?height:sh->disp_h-y, 0, y);
     }
 }
 


More information about the MPlayer-cvslog mailing list