summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-23 14:13:32 +0200
committerwm4 <wm4@nowhere>2015-09-23 14:20:50 +0200
commit2ed9370bd69806685ae18897831dac6ab90f5ea5 (patch)
tree7407e302ee38c56a0dd324564fa12673b9dbd4be /video/filter
parente0c005cb75d259a237b80046cecb903228b981ab (diff)
downloadmpv-2ed9370bd69806685ae18897831dac6ab90f5ea5.tar.bz2
mpv-2ed9370bd69806685ae18897831dac6ab90f5ea5.tar.xz
vf_vavpp: allocate output surfaces with the same size as input
This can happen if the hw decoder allocates padded surfaces (e.g. mod16), but the VPP output surface was allocated with the exact size. Apparently VPP requires matching input and output sizes, or it will add artifacts. In this case, it added mirrored pixels to the bottom few pixels. Note that the previous commit should have fixed this. But it didn't work, while this commit does. Fixes #2320.
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_vavpp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c
index a4a14e0dda..d50242190a 100644
--- a/video/filter/vf_vavpp.c
+++ b/video/filter/vf_vavpp.c
@@ -160,9 +160,12 @@ static struct mp_image *render(struct vf_instance *vf, struct mp_image *in,
if (!p->pipe.filters || in_id == VA_INVALID_ID)
return NULL;
- struct mp_image *img = mp_image_pool_get(p->pool, IMGFMT_VAAPI, in->w, in->h);
+ int r_w, r_h;
+ va_surface_get_uncropped_size(in, &r_w, &r_h);
+ struct mp_image *img = mp_image_pool_get(p->pool, IMGFMT_VAAPI, r_w, r_h);
if (!img)
return NULL;
+ mp_image_set_size(img, in->w, in->h);
bool need_end_picture = false;
bool success = false;