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

Laurent Aimar fenrir at via.ecp.fr
Thu Jul 17 22:20:57 CEST 2008


On Thu, Jul 17, 2008, 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).
> 
>  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, so from what I see:
 - vout is the only one that does not set pf_release callback.
 - a filter that want keeping an old frame coming from a vout:
   * will not be assured that the content will be unchanged as a decoder
     may reuse it.
   * will not segfault because the picture will never be released but just
     reused (pixels overwritten).

 Can someone confirm that it is the current state ?

 In the meantime, I will fix all i_refcount++ in image.c using the same trick.

-- 
fenrir




More information about the vlc-devel mailing list