[vlc-devel] [PATCH] picture_pool: copy the visible lines/pitch when cloning a picture from the pool

Steve Lhomme robux4 at gmail.com
Thu Aug 18 15:25:00 CEST 2016


On Thu, Aug 18, 2016 at 2:46 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le torstaina 18. elokuuta 2016, 14.27.34 EEST Steve Lhomme a écrit :
>> ---
>>  src/misc/picture_pool.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
>> index 8a507ac..987df94 100644
>> --- a/src/misc/picture_pool.c
>> +++ b/src/misc/picture_pool.c
>> @@ -109,6 +109,10 @@ static picture_t
>> *picture_pool_ClonePicture(picture_pool_t *pool, if (likely(clone != NULL))
>> {
>>          ((picture_priv_t *)clone)->gc.opaque = (void *)sys;
>>          picture_Hold(picture);
>> +        for (int i = 0; i < picture->i_planes; i++) {
>> +            clone->p[i].i_visible_pitch = picture->p[i].i_visible_pitch;
>> +            clone->p[i].i_visible_lines = picture->p[i].i_visible_lines;
>> +        }
>>      }
>>      return clone;
>>  }
>
> That looks like a hack. You don´t explain why it´s needed, and if it really is
> needed, it would seem out of place.

I think it's just logical that a clone has the same characteristics as
the original. Some are copied here [1] but not all of them. In the
case of offset_test.ogv, with the patch to include the y offset in the
visible lines, the visible lines end up being the value without the
offset, missing some lines when copying to/from that clone.

Now this issue is actually also a problem in patch
https://patches.videolan.org/patch/14283/. It patch
https://patches.videolan.org/patch/9995/ there was a
video_format_CopyCrop() that made sure the offset of the
video_format_t set when calling picture_Setup() is actually kept in
the picture video_format_t that is being created.

Ignore this patch I will prepare a new batch.

[1] http://git.videolan.org/?p=vlc.git;a=blob;f=src/misc/picture_pool.c;h=8a507acb5571c8fefe8ee47bc57cac2b4b6a0821;hb=HEAD#l102

> --
> Rémi Denis-Courmont
> http://www.remlab.net/
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list