[vlc-devel] [RFC] Moving services discovery out of the playlist

Romain Vimont rom1v at videolabs.io
Sun Jun 10 13:28:59 CEST 2018

Hi Rémi,

Thank you for your feedbacks.

On Fri, Jun 08, 2018 at 07:33:32PM +0300, Rémi Denis-Courmont wrote:
> Le perjantaina 8. kesäkuuta 2018, 18.05.58 EEST Romain Vimont a écrit :
> > Hi,
> > 
> > We would like to move services discovery out of the playlist, I explain
> > why and detail a proposal in this RFC:
> > <https://github.com/rom1v/vlc/blob/sd/rfc.md>
> > 
> > I would appreciate feedbacks ;-)
> playlist_IsServicesDiscoveryLoaded() is deprecated because it's broken by 
> design, and nobody proposed a sane alternative. Anything that tries to imitate 
> is thus presumed broken by design too. And that seems to include 
> media_browser_GetMediaSource().

AFAIU, playlist_IsServicesDiscoveryLoaded() is broken because it's
inherently racy.

I think that media_browser_GetMediaSource() is more equivalent to
playlist_ServicesDiscoveryAdd(), except that it creates/loads the SD
only if it was not already loaded, without race conditions (unless
there is a bug). Is something wrong with this?

> Also I don't see the point in reference counting. SD instances are not 
> reentrant, so I don't see what you can do with a reference to one.

Several concurrent clients (interfaces) may request a SD, in that case
GetMediaSource() returns the same media_source_t instance (containing
the same media tree).

Reference counting is used to release the instance (and close the SD)
when no more clients use it (in C++, a shared_ptr could have been used

More information about the vlc-devel mailing list