[vlc-devel] commit: Fixed image_Convert by properly overriding release policy. ( Laurent Aimar )

Pierre d'Herbemont pdherbemont at free.fr
Thu Jul 17 21:43:55 CEST 2008

On Jul 17, 2008, at 9:38 PM, Laurent Aimar wrote:

> On Thu, Jul 17, 2008, Pierre d'Herbemont wrote:
>> On Jul 17, 2008, at 9:22 PM, git version control wrote:
>>> vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Jul
>>> 17 21:23:19 2008 +0200| [796e72022f71598de3a162998a240632e65fed60]
>>> Fixed image_Convert by properly overriding release policy.
>>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=796e72022f71598de3a162998a240632e65fed60
>>> ---
>>> +    p_pic->pf_release = video_release_buffer_dummy;
>>>    p_pif = p_image->p_filter->pf_video_filter( p_image->p_filter,
>>> p_pic );
>>> +    p_pic->pf_release = pf_sav_release;
>> Does that means that pf_video_filter is trying to release p_pic? Why
>> don't we correct that in video filter plugin instead?
> The video filter does destroy the picture they are given when they do
> not need them anymore.
> It is by design and it is not a bug. (You cannot suppose when a video
> filter does not need the input picture anymore).

Well, isn't the refcounting for picture working? If someone wants to  
access a p_picture outside current scope it needs to retain it. When  
it is done, it releases it...

(Do I sound candid here? ;) )

> The bug is that image_Convert wasn't handling it correclty as it does
> not want this (default) behavior.
> Well now that I think of it, it is not completely correct as the  
> picture
> may be destroyed by image_Convert caller while the filter still need  
> it.
> In the current state (vout does not use pf_release but a special  
> scheme),
> there is no proper solution but to do a complete copy :(

Ok, I trust you, but I fear that we may leak something here... I am  
not familiar with the code though.


More information about the vlc-devel mailing list