[vlc-devel] [PATCH 23/48] vout: robustify "early" SPU blending
Rémi Denis-Courmont
remi at remlab.net
Wed Jul 3 17:23:18 CEST 2013
On Tue, 02 Jul 2013 23:29:25 +0200, Rafaël Carré <funman at videolan.org>
wrote:
> 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) {
Sure. In practice, spu_blend is not NULL, even if no blend module is
found. It is only NULL if malloc() failed during video output
initialization. I suppose Laurent made it so because the SPU blender object
potentially needs to support multiple subpicture chromas in succession.
To "properly" fix this, I believe the blend module probe should only
depend on the target picture format, while the subpicture format should be
passed as a parameter to the blending callback. That would require "every"
blend module to support all possible subpicture formats though.
--
Rémi Denis-Courmont
Sent from my collocated server
More information about the vlc-devel
mailing list