summaryrefslogtreecommitdiffstats
path: root/sub/img_convert.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-06-18 12:08:17 +0200
committerwm4 <wm4@nowhere>2016-06-18 12:08:17 +0200
commit9215a9e59889c7a2f600c618501ace1360bf810d (patch)
tree765772f6abbde2badcf4259a2e0479dd2ebe32ec /sub/img_convert.c
parent689cf04571109ea12b3cddc61a6eb43ceb768c63 (diff)
downloadmpv-9215a9e59889c7a2f600c618501ace1360bf810d.tar.bz2
mpv-9215a9e59889c7a2f600c618501ace1360bf810d.tar.xz
sd_lavc: align sub-bitmaps for the sake of libswscale
Since there are not many sub-rectangles, this doesn't cost too much. On the other hand, it avoids frequent warnings with vo_xv. Also, the second copy in mp_blur_rgba_sub_bitmap() can be dropped.
Diffstat (limited to 'sub/img_convert.c')
-rw-r--r--sub/img_convert.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sub/img_convert.c b/sub/img_convert.c
index 348811e773..78be881fdf 100644
--- a/sub/img_convert.c
+++ b/sub/img_convert.c
@@ -44,8 +44,7 @@ struct osd_conv_cache *osd_conv_cache_new(void)
void mp_blur_rgba_sub_bitmap(struct sub_bitmap *d, double gblur)
{
struct mp_image *tmp1 = mp_image_alloc(IMGFMT_BGRA, d->w, d->h);
- struct mp_image *tmp2 = mp_image_alloc(IMGFMT_BGRA, d->w, d->h);
- if (tmp1 && tmp2) { // on OOM, skip region
+ if (tmp1) { // on OOM, skip region
struct mp_image s = {0};
mp_image_setfmt(&s, IMGFMT_BGRA);
mp_image_set_size(&s, d->w, d->h);
@@ -54,12 +53,9 @@ void mp_blur_rgba_sub_bitmap(struct sub_bitmap *d, double gblur)
mp_image_copy(tmp1, &s);
- mp_image_sw_blur_scale(tmp2, tmp1, gblur);
-
- mp_image_copy(&s, tmp2);
+ mp_image_sw_blur_scale(&s, tmp1, gblur);
}
talloc_free(tmp1);
- talloc_free(tmp2);
}
// If RGBA parts need scaling, scale them.