[vlc-devel] [vlc-commits] lua: convert playlist parser to stream filter

Thomas Guillem thomas at gllm.fr
Thu May 18 09:24:32 CEST 2017

On Wed, May 17, 2017, at 18:34, Rémi Denis-Courmont wrote:
> Le keskiviikkona 17. toukokuuta 2017, 16.54.24 EEST Thomas Guillem a
> écrit :
> > Hello,
> > 
> > This commit causes every playlist lua scripts to be probed for all
> > inputs.
> That seems like the intended behaviour. It would be nice if Lua probing
> were 
> partially offloaded to native code and also if Lua scripts remained
> cached in 
> RAM. But that is not something that the original Lua run-time author or 
> anybody else ever bothered with.
> It would also be nice if stream filters and demuxers were probed in a
> unified 
> priority order. And it would have been easy if it had been done for
> access and 
> access_demux as it should have been done. But it was not done either.
> > There are probed from stream_FilterAutoNew() in InputDemuxNew().
> > This cause a massive performance issue when preparsing a lot of files,
> > this can double or triple the parse duration for one file.
> TBH, I have not perceived any subjective degradation. Optical drive
> accesses, 
> preparsing, art fetching, adn the UI have made directory parsing slow
> enough 
> to notice for years already.

Yes, VLC parsing is slow and can be improved a lot. Yes, the difference
of probing every lua playlist on Desktop is not important (around 5~10ms
per media), but this is not the case for every devices/OSes. On Android,
probing every lua playlist can take between 20ms and 60ms. That's the
same time than parsing a small audio file. So, on my Android device with
50GB of mp3, the parsing duration is almost doubled.

For 4.0 or later, we really need to cache lua in RAM like you said, but
in the meantime (3.0), we really need to find a way to disable lua when
parsing local files.

Or we can implement the lua caching now and add even more delay for the
3.0 release.

> > Also, since lua playlists normally only check the url, a matching lua
> > "stream-filter" will be added 16 times (because of the loop inside
> > stream_FilterAutoNew()) and playback will fail since the first filter
> > will consume the stream data. See
> > http://git.videolan.org/gitweb.cgi?p=vlc.git;a=blob;f=share/lua/playlist/you
> > tube.lua;h=7b63f91fa84a5da799e4a09a375448661deaf6df;hb=HEAD#l228 for a probe
> > example.
> Yes. That´s fixed now.
> -- 
> 雷米‧德尼-库尔蒙
> https://www.remlab.net/
> _______________________________________________
> 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