diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-02-17 23:46:57 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-02-17 23:46:57 +0000 |
commit | 84da7d44ef5b626f198dba84d15483745aabc7c7 (patch) | |
tree | 662780312abcf77596976d8b26ff5dafcd3f49ba | |
parent | 01df6700de05935c9fc1c595d406165f4b1008d4 (diff) | |
download | mpv-84da7d44ef5b626f198dba84d15483745aabc7c7.tar.bz2 mpv-84da7d44ef5b626f198dba84d15483745aabc7c7.tar.xz |
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.
The FFmpeg vp3/Theora decoder produces such slices.
Fixes bug #1646.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30630 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 29394317fe..a54254b80b 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -480,6 +480,7 @@ static void draw_slice(struct AVCodecContext *s, 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 AVCodecContext *s, } }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); } } |