[vlc-devel] commit: Implement access_GetParentInput and demux_GetParentInput and use. ( Pierre d'Herbemont )

Rémi Denis-Courmont remi at remlab.net
Wed Aug 26 21:29:00 CEST 2009


Le mercredi 26 août 2009 22:11:19 Pierre d'Herbemont, vous avez écrit :
> > How do you know that the caller is right or wrong?
>
> Just don't allow vlc_object_hold() on it. Then you are safe. Or make
> sure that you allow p_demux->psz_path to be NULL, and don't set a
> random value to it.

Why and how do I not allow vlc_object_hold()?

vlc_object_hold() creates a valid reference to a *generic* VLC object; with 
that I can at least get, set, register and register variables, crawl the 
objects tree, and emit log messages.

> What I am trying to point out, is that our API doesn't reflect the
> reality at all. You can vlc_object_hold() an object, but that won't
> actually let you live with a valid reference of it, with apparently no
> way to know it.

It *does* give a valid reference to the object.

> Either choose, we fix demux_Delete() or we make sure vlc_object_hold()
> doesn't work on that object.

That does not make any sense. It works fine now.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list