[MPlayer-cvslog] r29098 - in trunk/libmpcodecs: vd_ffmpeg.c vd_libmpeg2.c

reimar subversion at mplayerhq.hu
Sun Mar 29 16:15:09 CEST 2009


Author: reimar
Date: Sun Mar 29 16:15:09 2009
New Revision: 29098

Log:
Use MP_MAX_PLANES as size of arrays passed to mpcodecs_draw_slice.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c
   trunk/libmpcodecs/vd_libmpeg2.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Sun Mar 29 15:47:30 2009	(r29097)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Sun Mar 29 16:15:09 2009	(r29098)
@@ -451,7 +451,7 @@ static void draw_slice(struct AVCodecCon
                         AVFrame *src, int offset[4],
                         int y, int type, int height){
     sh_video_t *sh = s->opaque;
-    uint8_t *source[3]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]};
+    uint8_t *source[MP_MAX_PLANES]= {src->data[0] + offset[0], src->data[1] + offset[1], src->data[2] + offset[2]};
 #if 0
     int start=0, i;
     int width= s->width;

Modified: trunk/libmpcodecs/vd_libmpeg2.c
==============================================================================
--- trunk/libmpcodecs/vd_libmpeg2.c	Sun Mar 29 15:47:30 2009	(r29097)
+++ trunk/libmpcodecs/vd_libmpeg2.c	Sun Mar 29 16:15:09 2009	(r29098)
@@ -125,14 +125,12 @@ static void draw_slice (void * _sh, uint
     vd_libmpeg2_ctx_t *context = sh->context;
     mpeg2dec_t* mpeg2dec = context->mpeg2dec;
     const mpeg2_info_t * info = mpeg2_info (mpeg2dec);
-    int stride[3];
+    int stride[MP_MAX_PLANES] = {mpeg2dec->decoder.stride, mpeg2dec->decoder.uv_stride, mpeg2dec->decoder.uv_stride};
+    uint8_t *srcs[MP_MAX_PLANES] = {src[0], src[1], src[2]};
 
 //  printf("draw_slice() y=%d  \n",y);
 
-    stride[0]=mpeg2dec->decoder.stride;
-    stride[1]=stride[2]=mpeg2dec->decoder.uv_stride;
-
-    mpcodecs_draw_slice(sh, (uint8_t **)src,
+    mpcodecs_draw_slice(sh, srcs,
 		stride, info->sequence->picture_width,
 		(y+16<=info->sequence->picture_height) ? 16 :
 		    info->sequence->picture_height-y,


More information about the MPlayer-cvslog mailing list