[vlc-devel] [PATCH 00/12] Refactor browsing V2

Thomas Guillem thomas at gllm.fr
Tue May 19 10:27:40 CEST 2015


Second set of patches.
I addressed the following comments:
 - pf_readdir return an item or NULL
 - move directory demux options from src/libvlc-module.c to modules/demux/playlist/playlist.c
 - Fix possible infinite browsing loop with local fs access.

I also wanted to fix infinite browsing for every accesses. It's hard to do
since there are some protocols where you can't identify a regular file from a
symlink or where two same files have different id (it's the case for samba for
example). I thought about an algorithm that detect infinite loop by comparing
the path or the number of iteration, but was not happy with it. Therefore I
decided to deactivate auto play of remote accesses (or accesses that can't
detect infinite loop). For these accesses, if you open a directory, it will
parse the first level only, user will have to click again on the playlist if he
wants to play a directory inside.

I looked into the src/playlist code for the first time. I think there are some
stuffs to improve. We shouldn't parse directories from 2 different locations
(and possibly at the same time). Indeed, a directory can be parsed from the
preparser and from PlayItem. Maybe, PlayItem should be used only to play
regular files and have all directory parsing done from the preparser. I'll have
a look but I would prefer to have this first set of patches applied before.

Regards.


Thomas Guillem (12):
  sftp: fix crash when no directory is specified
  access: refactor pf_readdir
  access: extend STREAM_IS_DIRECTORY
  upnp: items are already sorted
  move directory-sort option from directory access to directory demux
  move ignore-filetypes option from directory access to directory demux
  access/directory: remove recursive code
  demux/directory: add show-hiddenfiles option
  demux/playlist: move recursive option
  playlist: don't play directories that can loop into themselves
  access: remote accesses can loop
  smb: implement readdir using libsmbclient

 include/vlc_access.h                |  13 +-
 include/vlc_input_item.h            |  10 +
 include/vlc_stream.h                |   8 +-
 modules/access/archive/stream.c     |  21 +-
 modules/access/directory.c          | 391 ++++++++----------------------------
 modules/access/dsm/access.c         | 134 ++++++------
 modules/access/file.c               |   6 +-
 modules/access/fs.c                 |  21 --
 modules/access/fs.h                 |   3 +-
 modules/access/ftp.c                |  21 +-
 modules/access/sftp.c               |  44 ++--
 modules/access/smb.c                | 186 ++++++++++++-----
 modules/demux/playlist/directory.c  | 155 ++++++++++++--
 modules/demux/playlist/playlist.c   |  41 ++++
 modules/demux/playlist/playlist.h   |   2 +-
 modules/services_discovery/upnp.cpp | 111 ++++++----
 modules/services_discovery/upnp.hpp |  16 +-
 src/input/demux.c                   |   6 +-
 src/input/item.c                    |  46 ++++-
 src/input/stream.c                  |  21 +-
 src/input/stream_filter.c           |   4 +-
 src/libvlc-module.c                 |  15 --
 src/libvlccore.sym                  |   1 +
 src/playlist/item.c                 |  16 ++
 24 files changed, 690 insertions(+), 602 deletions(-)

-- 
2.1.4




More information about the vlc-devel mailing list