Commit 8708b1d8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vout: robustify "early" SPU blending

If the picture copy fails or blending is unavailable(1), discard only
the subpicture and keep the original picture.

(1) In practice, this never happens as the blender object is kept
all the time even without a "blend" module.
parent 9fe4fdc6
...@@ -971,19 +971,19 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced) ...@@ -971,19 +971,19 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
bool is_direct = vout->p->decoder_pool == vout->p->display_pool; bool is_direct = vout->p->decoder_pool == vout->p->display_pool;
picture_t *todisplay = filtered; picture_t *todisplay = filtered;
if (do_early_spu && subpic) { if (do_early_spu && subpic) {
todisplay = picture_pool_Get(vout->p->private_pool); picture_t *blent = picture_pool_Get(vout->p->private_pool);
if (todisplay) { if (blent) {
VideoFormatCopyCropAr(&todisplay->format, &filtered->format); VideoFormatCopyCropAr(&blent->format, &filtered->format);
picture_Copy(todisplay, filtered); picture_Copy(blent, filtered);
if (vout->p->spu_blend) if (vout->p->spu_blend) {
picture_BlendSubpicture(todisplay, vout->p->spu_blend, subpic); picture_BlendSubpicture(blent, vout->p->spu_blend, subpic);
picture_Release(todisplay);
todisplay = blent;
} else
picture_Release(blent);
} }
picture_Release(filtered);
subpicture_Delete(subpic); subpicture_Delete(subpic);
subpic = NULL; subpic = NULL;
if (!todisplay)
return VLC_EGENERIC;
} }
assert(vout_IsDisplayFiltered(vd) == !sys->display.use_dr); assert(vout_IsDisplayFiltered(vd) == !sys->display.use_dr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment