[vlc-devel] commit: Implement access_GetParentInput and demux_GetParentInput and use. ( Pierre d'Herbemont )
Laurent Aimar
fenrir at via.ecp.fr
Wed Aug 26 20:06:24 CEST 2009
Hi,
On Wed, Aug 26, 2009, Pierre d'Herbemont wrote:
>
> On Aug 26, 2009, at 5:12 PM, Rémi Denis-Courmont wrote:
>
>> Le mercredi 26 août 2009 17:42:01 Pierre d'Herbemont, vous avez écrit :
>>> First, demux and access don't properly implement refcounting. If
>>> someone is holding a reference to it, its data might get destroyed,
>>> and lead to crash for free.
>>
>> How so? To my knowledge *none* of the demux_t and access_t specific
>> members
>> are thread-safe. So none of them should be accessed from
>> vlc_object_find(_name).
>
> Are they really?
>
> demux_IsPathExtension()
> {
> const char *psz_ext = strrchr ( p_demux->psz_path, '.' );
> if( !psz_ext || strcasecmp( psz_ext, psz_extension ) )
> return false;
> }
This function can only be called inside a demuxer function (open, demux,
control) or the input core, and so are safe from demux_Delete.
The only way to interact with a demuxer/access from outside the module itself
and the input core is through var_* (not sure there is any but it could be).
This is the general case of nearly all object except input_thread_t, vout_thread_t
and aout_instance_t (they might be others). And then, even for them, only a
subpart of the API can be used if you are not the *owner* of the object.
--
fenrir
More information about the vlc-devel
mailing list