[vlc-devel] [PATCH 2/4] playlist: introduce playlist repository

Romain Vimont rom1v at videolabs.io
Mon Aug 24 21:37:11 CEST 2020


On Mon, Aug 24, 2020 at 08:16:04AM +0200, Steve Lhomme wrote:
> On 2020-08-20 17:44, Romain Vimont wrote:
> > Store the main playlist in a "playlist repo".
> > 
> > This new component will be able to manage several playlists.
> > ---
> >   include/vlc_playlist.h    |  39 +++++++++++
> >   src/Makefile.am           |   2 +
> >   src/interface/interface.c |  67 +-----------------
> >   src/libvlc.c              |  11 ++-
> >   src/libvlc.h              |   4 +-
> >   src/libvlccore.sym        |   3 +
> >   src/playlist/repo.c       | 142 ++++++++++++++++++++++++++++++++++++++
> >   src/playlist/repo.h       |  34 +++++++++
> >   8 files changed, 232 insertions(+), 70 deletions(-)
> >   create mode 100644 src/playlist/repo.c
> >   create mode 100644 src/playlist/repo.h
> > 
> > diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
> > index 2c11cf8fd7..9a1c66e3dc 100644
> > --- a/include/vlc_playlist.h
> > +++ b/include/vlc_playlist.h
> > @@ -886,6 +886,45 @@ VLC_API int
> >   vlc_playlist_Export(vlc_playlist_t *playlist, const char *filename,
> >                       const char *type);
> > +/** Playlist repository (opaque) */
> > +typedef struct vlc_playlist_repo vlc_playlist_repo_t;
> > +
> > +/**
> > + * Return the playlist repository.
> > + *
> > + * \param libvlc the libvlc instance
> > + * \return the playlist repo
> > + */
> > +VLC_API vlc_playlist_repo_t *
> > +libvlc_GetPlaylistRepo(libvlc_int_t *libvlc);
> > +
> > +/**
> > + * Return the main playlist.
> > + *
> > + * This does not increment the playlist refcount. The playlist is guaranteed to
> > + * exist until the libvlc instance is destroyed.
> > + *
> > + * \param the playlist repo
> > + * \return the main playlist
> > + */
> > +VLC_API vlc_playlist_t *
> > +vlc_playlist_repo_GetMainPlaylist(vlc_playlist_repo_t *repo);
> 
> Since you're introducing VLC_MAIN_PLAYLIST_ID in the next patch it seems
> this special call(s) is not needed and should use the more generic API with
> VLC_MAIN_PLAYLIST_ID.

True. Updated: https://code.videolan.org/rom1v/vlc/-/commits/vlm.14

Thank you.


More information about the vlc-devel mailing list