[vlc-commits] intf: move linked-list head to libvlc_priv_t
Thomas Guillem
git at videolan.org
Fri Mar 8 09:54:09 CET 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Mar 8 09:45:50 2019 +0100| [40acc0491ab89d0cf2060d540d9d34e8eb5698d5] | committer: Thomas Guillem
intf: move linked-list head to libvlc_priv_t
For the playlist_t => vlc_playlist_t transition.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=40acc0491ab89d0cf2060d540d9d34e8eb5698d5
---
src/interface/interface.c | 8 +++++---
src/libvlc.c | 1 +
src/libvlc.h | 1 +
src/playlist_legacy/playlist_internal.h | 1 -
4 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/interface/interface.c b/src/interface/interface.c
index 0342e7a1b5..278f5deeaf 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -93,6 +93,7 @@ static int intf_CreateInternal( libvlc_int_t *libvlc, playlist_t *playlist,
if (!playlist)
return VLC_EGENERIC;
}
+ libvlc_priv_t *priv = libvlc_priv(vlc_object_instance(playlist));
/* Allocate structure */
intf_thread_t *p_intf = vlc_custom_create( playlist, sizeof( *p_intf ),
@@ -135,8 +136,8 @@ static int intf_CreateInternal( libvlc_int_t *libvlc, playlist_t *playlist,
}
vlc_mutex_lock( &lock );
- p_intf->p_next = pl_priv( playlist )->interface;
- pl_priv( playlist )->interface = p_intf;
+ p_intf->p_next = priv->interface;
+ priv->interface = p_intf;
vlc_mutex_unlock( &lock );
return VLC_SUCCESS;
@@ -309,13 +310,14 @@ int libvlc_InternalAddIntf(libvlc_int_t *libvlc, const char *name)
*/
void intf_DestroyAll(libvlc_int_t *libvlc)
{
+ libvlc_priv_t *priv = libvlc_priv(libvlc);
playlist_t *playlist;
vlc_mutex_lock(&lock);
playlist = libvlc_priv(libvlc)->playlist;
if (playlist != NULL)
{
- intf_thread_t *intf, **pp = &(pl_priv(playlist)->interface);
+ intf_thread_t *intf, **pp = &priv->interface;
while ((intf = *pp) != NULL)
{
diff --git a/src/libvlc.c b/src/libvlc.c
index 62d8d945a2..9cb6924ca8 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -94,6 +94,7 @@ libvlc_int_t * libvlc_InternalCreate( void )
return NULL;
priv = libvlc_priv (p_libvlc);
+ priv->interface = NULL;
priv->playlist = NULL;
priv->main_playlist = NULL;
priv->p_vlm = NULL;
diff --git a/src/libvlc.h b/src/libvlc.h
index c8fab1ca11..2f4cf77b80 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -186,6 +186,7 @@ typedef struct libvlc_priv_t
vlm_t *p_vlm; ///< the VLM singleton (or NULL)
vlc_dialog_provider *p_dialog_provider; ///< dialog provider
vlc_keystore *p_memory_keystore; ///< memory keystore
+ struct intf_thread_t *interface; ///< Linked-list of interfaces
struct playlist_t *playlist; ///< Playlist for interfaces
vlc_playlist_t *main_playlist;
struct input_preparser_t *parser; ///< Input item meta data handler
diff --git a/src/playlist_legacy/playlist_internal.h b/src/playlist_legacy/playlist_internal.h
index 51b34a6f3d..d965d6b673 100644
--- a/src/playlist_legacy/playlist_internal.h
+++ b/src/playlist_legacy/playlist_internal.h
@@ -43,7 +43,6 @@ void playlist_ServicesDiscoveryKillAll( playlist_t *p_playlist );
typedef struct playlist_private_t
{
playlist_t public_data;
- struct intf_thread_t *interface; /**< Linked-list of interfaces */
void *input_tree; /**< Search tree for input item
to playlist item mapping */
More information about the vlc-commits
mailing list