diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-29 14:15:09 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-29 14:15:09 +0000 |
commit | 22b2f80efba0c14feda562733fd117be7f340b31 (patch) | |
tree | 9a005f890f4a976929397d7a3ed5fc76db41603b | |
parent | f9aefa045f426373c9c87849ab7c10c22bc90061 (diff) |
Use MP_MAX_PLANES as size of arrays passed to mpcodecs_draw_slice.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29098 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vd_libmpeg2.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index e8e53cae2b..f499e8e424 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -451,7 +451,7 @@ static void draw_slice(struct AVCodecContext *s, 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; diff --git a/libmpcodecs/vd_libmpeg2.c b/libmpcodecs/vd_libmpeg2.c index fdcb5cd2e3..aeee735076 100644 --- a/libmpcodecs/vd_libmpeg2.c +++ b/libmpcodecs/vd_libmpeg2.c @@ -125,14 +125,12 @@ static void draw_slice (void * _sh, uint8_t * const * src, unsigned int y){ 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, |