[vlc-commits] playlist: remove playlist_item_t.p_playlist
Rémi Denis-Courmont
git at videolan.org
Fri Nov 18 21:41:00 CET 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 18 22:39:18 2016 +0200| [ed100a38ce60d72181acca0f9240f137913fd9de] | committer: Rémi Denis-Courmont
playlist: remove playlist_item_t.p_playlist
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ed100a38ce60d72181acca0f9240f137913fd9de
---
include/vlc_playlist.h | 2 --
src/playlist/item.c | 5 -----
src/playlist/services_discovery.c | 2 +-
src/playlist/tree.c | 5 +++--
4 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 4e50ee9..a40c903 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -139,8 +139,6 @@ struct playlist_item_t
int i_id; /**< Playlist item specific id */
uint8_t i_flags; /**< Flags \see playlist_item_flags_e */
-
- playlist_t *p_playlist; /**< Parent playlist */
};
typedef enum {
diff --git a/src/playlist/item.c b/src/playlist/item.c
index dcab46c..5a77b41 100644
--- a/src/playlist/item.c
+++ b/src/playlist/item.c
@@ -271,7 +271,6 @@ playlist_item_t *playlist_ItemNewFromInput( playlist_t *p_playlist,
p_item->pp_children = NULL;
p_item->i_nb_played = 0;
p_item->i_flags = 0;
- p_item->p_playlist = p_playlist;
PL_ASSERT_LOCKED;
@@ -766,10 +765,6 @@ void playlist_SendAddNotify( playlist_t *p_playlist, playlist_item_t *item,
*/
mtime_t playlist_GetNodeDuration( playlist_item_t* node )
{
- /* For the assert */
- playlist_t *p_playlist = node->p_playlist;
- PL_ASSERT_LOCKED;
-
mtime_t mt_duration = 0;
if( node->i_children != -1 )
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 650fc20..5b96f31 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -189,8 +189,8 @@ static void playlist_sd_item_removed(services_discovery_t *sd,
input_item_t *p_input)
{
vlc_sd_internal_t *sds = sd->owner.sys;
+ playlist_t *p_playlist = (playlist_t *)sd->obj.parent;
playlist_item_t *p_sd_node = sds->node;
- playlist_t *p_playlist = p_sd_node->p_playlist;
PL_LOCK;
playlist_item_t *p_item =
diff --git a/src/playlist/tree.c b/src/playlist/tree.c
index 4ff5a7d..04c4618 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -176,6 +176,9 @@ int playlist_NodeInsert( playlist_t *p_playlist,
/**
* Search a child of a node by its name
*
+ * \note The playlist must be locked, and the result is only valid until the
+ * playlist is unlocked.
+ *
* \param p_node the node
* \param psz_search the name of the child to search
* \return the child item or NULL if not found or error
@@ -183,8 +186,6 @@ int playlist_NodeInsert( playlist_t *p_playlist,
playlist_item_t *playlist_ChildSearchName( playlist_item_t *p_node,
const char *psz_search )
{
- playlist_t * p_playlist = p_node->p_playlist; /* For assert_locked */
- PL_ASSERT_LOCKED;
int i;
if( p_node->i_children < 0 )
More information about the vlc-commits
mailing list