[vlc-devel] [PATCH 0/5] input/url factor and moar tests

Rémi Denis-Courmont remi at remlab.net
Thu Nov 5 13:31:47 CET 2015

Le 2015-11-05 15:23, Thomas Guillem a écrit :
> On Thu, Nov 5, 2015, at 13:11, Rémi Denis-Courmont wrote:
>> Le 2015-11-05 14:09, Thomas Guillem a écrit :
>> > The first 3 patches add vlc_uri2fd and input_stat2type that are 
>> used
>> > by
>> > file/directory accesses and also by input_item in order to detect 
>> the
>> > item type via an URI.
>> That looks totally overkill.
>> The input item type was meant for UIs to pick different icons. Not
>> more, not less.
> Now, it is also used by the preparser. It's important to pre identify
> the type of item in order to don't preparse networks streams.

You _cannot_ rely on the input item type being correct. For files, 
directories and special files, you would have to to keeping the file 
descriptor within the input item to avoid ToCToU. This is not practical 
because of the very finite limit of concurrently open descriptors.

Rémi Denis-Courmont

More information about the vlc-devel mailing list