summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 00:00:06 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 00:00:06 +0200
commitc37f09693d0edb632c80f8f38ecdb2faf3547f7f (patch)
tree44df07eacb522a97bbecd7a3a0f93e8d6a933003 /libmpcodecs/vd_ffmpeg.c
parent22a06c4ae5672c1dd629918d0a279b8af24e35c3 (diff)
parent2aafb808284d74edab6e5320e1114f5c74d5881e (diff)
downloadmpv-c37f09693d0edb632c80f8f38ecdb2faf3547f7f.tar.bz2
mpv-c37f09693d0edb632c80f8f38ecdb2faf3547f7f.tar.xz
Merge svn changes up to r30643
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 83fe050051..27cb4134cc 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -410,6 +410,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;
@@ -433,8 +434,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);
}
}