[vlc-devel] [PATCH 08/10] Removes xspf generation in access/directory.c in favor of new pf_readdir callback

Julien 'Lta' BALLET contact at lta.io
Mon Jun 16 18:54:44 CEST 2014


>
>
>> ************************************************************
>> *****************/
>> +typedef struct directory directory;
>> +struct directory
>>  {
>> -    directory_t *parent;
>>      DIR         *handle;
>>      char        *uri;
>>      char       **filev;
>>
>
> That structure only exists because of recursion. If you remove recursion,
> you should remove this structure as well.
>
>
I've inlined the data i still need in the access_sys_t.


>
>  -#ifdef HAVE_OPENAT
>> -/* Detect directories that recurse into themselves. */
>> -static bool has_inode_loop (const directory_t *dir, dev_t dev, ino_t
>> inode)
>> -{
>> -    while (dir != NULL)
>> -    {
>> -        if ((dir->device == dev) && (dir->inode == inode))
>> -            return true;
>> -        dir = dir->parent;
>> -    }
>> -    return false;
>> -}
>> -#endif
>>
>
> What will prevent infinite recursion in the playlist after this gets
> removed?
>
>
I've actually no good idea to handle this in a generic way and your light
on this issue would be greatly appreciated.

Felix was in Paris today and he suggested to basically store the file's
inode number inside the input item, but it'll only solve the issue for
local filesystem. That won't solve the problem for loop in remote folders
(ftp, smb, etc.).
J-b, on the other hand, was suggesting that maybe we could limit recursion
to a certain configurable depth, the user being still able to unfold the
item by playing it.

What's your opinion on this ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140616/a87f949b/attachment.html>


More information about the vlc-devel mailing list