Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
cc67adbf
Commit
cc67adbf
authored
Nov 16, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist: remove constant playlist_NodeDelete() parameter
parent
a71f611f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
18 deletions
+15
-18
include/vlc_playlist.h
include/vlc_playlist.h
+1
-1
modules/control/dbus/dbus_tracklist.c
modules/control/dbus/dbus_tracklist.c
+1
-1
modules/gui/ncurses.c
modules/gui/ncurses.c
+1
-1
modules/gui/qt/dialogs_provider.cpp
modules/gui/qt/dialogs_provider.cpp
+1
-1
modules/gui/skins2/vars/playtree.cpp
modules/gui/skins2/vars/playtree.cpp
+1
-1
src/playlist/item.c
src/playlist/item.c
+3
-3
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+3
-3
src/playlist/tree.c
src/playlist/tree.c
+4
-7
No files found.
include/vlc_playlist.h
View file @
cc67adbf
...
...
@@ -353,7 +353,7 @@ VLC_API int playlist_LiveSearchUpdate(playlist_t *, playlist_item_t *, const cha
/* Node management */
VLC_API
playlist_item_t
*
playlist_NodeCreate
(
playlist_t
*
,
const
char
*
,
playlist_item_t
*
p_parent
,
int
i_pos
,
int
i_flags
,
input_item_t
*
);
VLC_API
playlist_item_t
*
playlist_ChildSearchName
(
playlist_item_t
*
,
const
char
*
)
VLC_USED
;
VLC_API
void
playlist_NodeDelete
(
playlist_t
*
,
playlist_item_t
*
,
bool
,
bool
);
VLC_API
void
playlist_NodeDelete
(
playlist_t
*
,
playlist_item_t
*
,
bool
);
/**************************
* Audio output management
...
...
modules/control/dbus/dbus_tracklist.c
View file @
cc67adbf
...
...
@@ -267,7 +267,7 @@ DBUS_METHOD( RemoveTrack )
if
(
item
->
i_id
==
i_id
)
{
playlist_NodeDelete
(
p_playlist
,
item
,
true
,
false
);
playlist_NodeDelete
(
p_playlist
,
item
,
false
);
break
;
}
}
...
...
modules/gui/ncurses.c
View file @
cc67adbf
...
...
@@ -1345,7 +1345,7 @@ static bool HandlePlaylistKey(intf_thread_t *intf, int key)
if
(
item
->
i_children
==
-
1
)
playlist_DeleteFromInput
(
p_playlist
,
item
->
p_input
,
pl_Locked
);
else
playlist_NodeDelete
(
p_playlist
,
item
,
true
,
false
);
playlist_NodeDelete
(
p_playlist
,
item
,
false
);
PL_UNLOCK
;
vlc_mutex_lock
(
&
sys
->
pl_lock
);
if
(
sys
->
box_idx
>=
sys
->
box_lines_total
-
1
)
...
...
modules/gui/qt/dialogs_provider.cpp
View file @
cc67adbf
...
...
@@ -682,7 +682,7 @@ void DialogsProvider::saveRecentsToPlaylist()
saveAPlaylist
(
THEPL
,
p_node_recents
);
playlist_Lock
(
THEPL
);
playlist_NodeDelete
(
THEPL
,
p_node_recents
,
true
,
false
);
playlist_NodeDelete
(
THEPL
,
p_node_recents
,
false
);
playlist_Unlock
(
THEPL
);
}
...
...
modules/gui/skins2/vars/playtree.cpp
View file @
cc67adbf
...
...
@@ -66,7 +66,7 @@ void Playtree::delSelected()
}
else
{
playlist_NodeDelete
(
m_pPlaylist
,
pItem
,
true
,
false
);
playlist_NodeDelete
(
m_pPlaylist
,
pItem
,
false
);
}
}
playlist_Unlock
(
m_pPlaylist
);
...
...
src/playlist/item.c
View file @
cc67adbf
...
...
@@ -110,7 +110,7 @@ static void input_item_add_subitem_tree ( const vlc_event_t * p_event,
}
assert
(
i
<
p_parent
->
i_children
);
playlist_NodeDelete
(
p_playlist
,
p_item
,
true
,
false
);
playlist_NodeDelete
(
p_playlist
,
p_item
,
false
);
/* If there is a pending request referring to the item we just deleted
* it needs to be updated so that we do not try to play an entity that
...
...
@@ -329,7 +329,7 @@ static int DeleteFromInput( playlist_t *p_playlist, input_item_t *p_input,
playlist_item_t
*
p_item
=
playlist_ItemFindFromInputAndRoot
(
p_playlist
,
p_input
,
p_root
,
false
);
if
(
!
p_item
)
return
VLC_EGENERIC
;
playlist_NodeDelete
(
p_playlist
,
p_item
,
true
,
false
);
playlist_NodeDelete
(
p_playlist
,
p_item
,
false
);
return
VLC_SUCCESS
;
}
...
...
@@ -401,7 +401,7 @@ int playlist_DeleteFromItemId( playlist_t *p_playlist, int i_id )
PL_ASSERT_LOCKED
;
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
p_playlist
,
i_id
);
if
(
!
p_item
)
return
VLC_EGENERIC
;
playlist_NodeDelete
(
p_playlist
,
p_item
,
true
,
false
);
playlist_NodeDelete
(
p_playlist
,
p_item
,
false
);
return
VLC_SUCCESS
;
}
...
...
src/playlist/services_discovery.c
View file @
cc67adbf
...
...
@@ -206,9 +206,9 @@ static void playlist_sd_item_removed(services_discovery_t *sd,
/* if the item was added under a category and the category node
becomes empty, delete that node as well */
if
(
p_parent
->
i_children
>
1
||
p_parent
==
p_sd_node
)
playlist_NodeDelete
(
p_playlist
,
p_item
,
true
,
false
);
playlist_NodeDelete
(
p_playlist
,
p_item
,
false
);
else
playlist_NodeDelete
(
p_playlist
,
p_parent
,
true
,
true
);
playlist_NodeDelete
(
p_playlist
,
p_parent
,
true
);
PL_UNLOCK
;
}
...
...
@@ -259,7 +259,7 @@ static void playlist_ServicesDiscoveryInternalRemove(playlist_t *playlist,
/* Remove the sd playlist node if it exists */
playlist_Lock
(
playlist
);
if
(
sds
->
node
!=
NULL
)
playlist_NodeDelete
(
playlist
,
sds
->
node
,
true
,
false
);
playlist_NodeDelete
(
playlist
,
sds
->
node
,
false
);
playlist_Unlock
(
playlist
);
free
(
sds
);
...
...
src/playlist/tree.c
View file @
cc67adbf
...
...
@@ -109,8 +109,7 @@ void playlist_NodeEmpty( playlist_t *p_playlist, playlist_item_t *p_root )
{
if
(
p_root
->
pp_children
[
i
]
->
i_children
>
-
1
)
{
playlist_NodeDelete
(
p_playlist
,
p_root
->
pp_children
[
i
],
true
,
false
);
playlist_NodeDelete
(
p_playlist
,
p_root
->
pp_children
[
i
],
false
);
}
else
{
...
...
@@ -126,18 +125,16 @@ void playlist_NodeEmpty( playlist_t *p_playlist, playlist_item_t *p_root )
*
* \param p_playlist the playlist
* \param p_root the node
* \param b_delete_items do we have to delete the children items ?
*/
void
playlist_NodeDelete
(
playlist_t
*
p_playlist
,
playlist_item_t
*
p_root
,
bool
b_delete_items
,
bool
b_force
)
bool
b_force
)
{
PL_ASSERT_LOCKED
;
/* Delete the children */
for
(
int
i
=
p_root
->
i_children
-
1
;
i
>=
0
;
i
--
)
if
(
b_delete_items
||
p_root
->
pp_children
[
i
]
->
i_children
>=
0
)
playlist_NodeDelete
(
p_playlist
,
p_root
->
pp_children
[
i
],
b_delete_items
,
b_force
);
if
(
p_root
->
pp_children
[
i
]
->
i_children
>=
0
)
playlist_NodeDelete
(
p_playlist
,
p_root
->
pp_children
[
i
],
b_force
);
/* Delete the node */
if
(
p_root
->
i_flags
&
PLAYLIST_RO_FLAG
&&
!
b_force
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment