[vlc-devel] [PATCH] dsm: mark directories in readdir

Thomas Guillem thomas at gllm.fr
Thu Mar 19 15:02:22 CET 2015


On Thu, Mar 19, 2015, at 10:36, Petri Hintukainen wrote:
> 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)
> > see
> > https://mailman.videolan.org/pipermail/vlc-devel/2015-February/101211.html
> > and
> > https://mailman.videolan.org/pipermail/vlc-devel/2015-February/101212.html
> > 
> > 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 ?

No, but there are files that are browsable (playlist, archive).

>  
> > 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
> disables browsing).
> 
> > 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 ?

The preparsing is done in src/playlist/preparser.c.
Recently I did a patch that enable preparsing of directories and nodes.
But I introduced the recursive preparsing regression and some others
bugs. I was stuck in some others things. I'll start to fix these
regressions soon.

My goal is like you said: subdirectories should be shown as collapsed
(or browsable), and be preparsed only when expanded. I'll have a look in
src/playlist/preparser.c

> 
> 
> - Petri
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list