[vlc-devel] [PATCH] dsm: mark directories in readdir
phintuka at users.sourceforge.net
Thu Mar 19 10:36:55 CET 2015
On ke, 2015-03-18 at 10:20 +0100, Thomas Guillem wrote:
> Hi Petri,
> I already proposed some patches to know if an item is a directory (or
> browsable in my case)
> But I'm not sure which one is the best solution.
Ok, I didn't notice those patches earlier. I just noticed this
problem with directories while testing smb browsing.
> The ITEM_TYPE_* seems to be used mainly for UI (from Qt). Third party
> applications using libvlc for browsing files/smb/sftp/upnp will need to
> know if an item is a directory or is browsable.
What is the exact difference between these two ? Are there directories
that are not browsable ?
> The problem using ITEM_TYPE_ is that an item can be a net and a
> directory. Which one do you choose ? Maybe we should use a bitmask and
> have i_type = ITEM_TYPE_NET|ITEM_TYPE_DIRECTORY.
> An other issue with your patch is that the preparser will preparses all
> items that are directory. Therefore all children directories will be
> preparsed recursively and we don't want that. Indeed we want to parse
> only when clicking on the item from the playlist/browser.
Yes, I noticed this (playlist was huge, 100 000's of files).
This should definitely be fixed before enabling the feature.
The problem exists also with local filesystem, pointing vlc to
root reads all files in the disc. There's an option to disable
it, but it is only used with local files (and efficiently
> I'm still thinking about the proper way to have a valid
> item_type/item_browsable and have the preparser not preparsing all the
> children recursively.
Yes, ideally subdirectories would be shown as collapsed, and
be preparsed when expanded. Currently browsing is difficult,
clicking a directory starts playing it recursively instead
of opening / preparsig it. Only preparsed directories can
be expanded in (qt) gui.
So this is not access plugin problem, but should be handled at
some higher layer. Maybe preparsing should be limited to only
one directory level, and deeper directories be preparsed
at request (when expanded in playlist tree) ?
I haven't even looked at (qt) gui code. Maybe someone with
deeper gui knowledge can tell how easy this would be to
implement, and if there are some problems I'm missing ?
Would it be enough to request preparsing instead of playback
when (not yet preparsed) directory item is clicked ? Or add
that small 'v' icon also to directories that are not
preparsed, and use it to trigger preparsing ?
More information about the vlc-devel