[vlc-devel] [PATCH 23/48] vout: robustify "early" SPU blending
Rafaël Carré
funman at videolan.org
Tue Jul 2 23:29:25 CEST 2013
Hello, here is my suggestion:
Le 02/07/2013 19:51, Rémi Denis-Courmont a écrit :
> 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.
> ---
> src/video_output/video_output.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
> index d2a898d..26eca24 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -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;
> picture_t *todisplay = filtered;
> if (do_early_spu && subpic) {
> - todisplay = picture_pool_Get(vout->p->private_pool);
> - if (todisplay) {
> - VideoFormatCopyCropAr(&todisplay->format, &filtered->format);
> - picture_Copy(todisplay, filtered);
> - if (vout->p->spu_blend)
> - picture_BlendSubpicture(todisplay, vout->p->spu_blend, subpic);
if (vout->p->spu_blend) {
> + picture_t *blent = picture_pool_Get(vout->p->private_pool);
> + if (blent) {
> + VideoFormatCopyCropAr(&blent->format, &filtered->format);
> + picture_Copy(blent, filtered);
> + if (vout->p->spu_blend) {
> + picture_BlendSubpicture(blent, vout->p->spu_blend, subpic);
> + picture_Release(todisplay);
> + todisplay = blent;
> + } else
> + picture_Release(blent);
remove these
> }
}
> - picture_Release(filtered);
> subpicture_Delete(subpic);
> subpic = NULL;
> -
> - if (!todisplay)
> - return VLC_EGENERIC;
> }
>
> assert(vout_IsDisplayFiltered(vd) == !sys->display.use_dr);
>
More information about the vlc-devel
mailing list