Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
cc321882
Commit
cc321882
authored
May 16, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist_DeleteFromInput: pass the input item rather than its ID
parent
bbba5c6f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
27 additions
and
26 deletions
+27
-26
include/vlc_playlist.h
include/vlc_playlist.h
+2
-2
modules/control/dbus.c
modules/control/dbus.c
+1
-1
modules/control/http/macro.c
modules/control/http/macro.c
+2
-2
modules/control/http/rpn.c
modules/control/http/rpn.c
+1
-1
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+1
-1
modules/gui/ncurses.c
modules/gui/ncurses.c
+1
-1
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+1
-1
modules/gui/skins2/vars/playtree.cpp
modules/gui/skins2/vars/playtree.cpp
+1
-1
modules/gui/wince/playlist.cpp
modules/gui/wince/playlist.cpp
+1
-1
src/playlist/item.c
src/playlist/item.c
+13
-13
src/playlist/playlist_internal.h
src/playlist/playlist_internal.h
+2
-1
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+1
-1
No files found.
include/vlc_playlist.h
View file @
cc321882
...
...
@@ -111,7 +111,7 @@ TYPEDEF_ARRAY(playlist_item_t*, playlist_item_array_t);
* Generally speaking, playlist_NodeAddInput should not be used in newer code, it
* will maybe become useful again when we merge VLM;
*
* To delete an item, use playlist_DeleteFromInput(
input_id
) which will
* To delete an item, use playlist_DeleteFromInput(
p_item
) which will
* remove all occurrences of the input in both trees
*
*
...
...
@@ -322,7 +322,7 @@ VLC_EXPORT( bool, playlist_IsServicesDiscoveryLoaded, ( playlist_t *,const char
********************************************************/
/*************************** Item deletion **************************/
VLC_EXPORT
(
int
,
playlist_DeleteFromInput
,
(
playlist_t
*
,
in
t
,
bool
)
);
VLC_EXPORT
(
int
,
playlist_DeleteFromInput
,
(
playlist_t
*
,
in
put_item_t
*
,
bool
)
);
/******************** Item addition ********************/
VLC_EXPORT
(
int
,
playlist_Add
,
(
playlist_t
*
,
const
char
*
,
const
char
*
,
int
,
int
,
bool
,
bool
)
);
...
...
modules/control/dbus.c
View file @
cc321882
...
...
@@ -514,7 +514,7 @@ DBUS_METHOD( DelTrack )
if
(
i_position
<
p_playlist
->
current
.
i_size
)
{
playlist_DeleteFromInput
(
p_playlist
,
p_playlist
->
current
.
p_elems
[
i_position
]
->
p_input
->
i_id
,
p_playlist
->
current
.
p_elems
[
i_position
]
->
p_input
,
pl_Locked
);
}
PL_UNLOCK
;
...
...
modules/control/http/macro.c
View file @
cc321882
...
...
@@ -381,7 +381,7 @@ static void MacroDo( httpd_file_sys_t *p_args,
p_items
[
i
]
);
if
(
p_item
)
playlist_DeleteFromInput
(
p_sys
->
p_playlist
,
p_item
->
p_input
->
i_id
,
p_item
->
p_input
,
false
);
}
...
...
@@ -424,7 +424,7 @@ static void MacroDo( httpd_file_sys_t *p_args,
msg_Dbg
(
p_intf
,
"requested playlist delete: %d"
,
p_sys
->
p_playlist
->
items
.
p_elems
[
i
]
->
i_id
);
playlist_DeleteFromInput
(
p_sys
->
p_playlist
,
p_sys
->
p_playlist
->
items
.
p_elems
[
i
]
->
p_input
->
i_id
,
p_sys
->
p_playlist
->
items
.
p_elems
[
i
]
->
p_input
,
false
);
}
}
...
...
modules/control/http/rpn.c
View file @
cc321882
...
...
@@ -875,7 +875,7 @@ void EvaluateRPN( intf_thread_t *p_intf, mvar_t *vars,
if
(
p_item
)
{
playlist_DeleteFromInput
(
p_sys
->
p_playlist
,
p_item
->
p_input
->
i_id
,
pl_Locked
);
p_item
->
p_input
,
pl_Locked
);
msg_Dbg
(
p_intf
,
"requested playlist delete: %d"
,
i_id
);
}
else
...
...
modules/gui/macosx/playlist.m
View file @
cc321882
...
...
@@ -968,7 +968,7 @@
playlist_NodeDelete
(
p_playlist
,
p_item
,
true
,
false
);
}
else
playlist_DeleteFromInput
(
p_playlist
,
p_item
->
p_input
->
i_id
,
pl_Locked
);
playlist_DeleteFromInput
(
p_playlist
,
p_item
->
p_input
,
pl_Locked
);
}
PL_UNLOCK
;
...
...
modules/gui/ncurses.c
View file @
cc321882
...
...
@@ -656,7 +656,7 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
if
(
p_item
->
i_children
==
-
1
)
{
playlist_DeleteFromInput
(
p_playlist
,
p_item
->
p_input
->
i_id
,
pl_Locked
);
p_item
->
p_input
,
pl_Locked
);
}
else
{
...
...
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
cc321882
...
...
@@ -719,7 +719,7 @@ void PLModel::doDeleteItem( PLItem *item, QModelIndexList *fullList )
return
;
}
if
(
p_item
->
i_children
==
-
1
)
playlist_DeleteFromInput
(
p_playlist
,
item
->
i_input_id
,
pl_Locked
);
playlist_DeleteFromInput
(
p_playlist
,
p_item
->
p_input
,
pl_Locked
);
else
playlist_NodeDelete
(
p_playlist
,
p_item
,
true
,
false
);
/* And finally, remove it from the tree */
...
...
modules/gui/skins2/vars/playtree.cpp
View file @
cc321882
...
...
@@ -74,7 +74,7 @@ void Playtree::delSelected()
if
(
p_item
->
i_children
==
-
1
)
{
playlist_DeleteFromInput
(
getIntf
()
->
p_sys
->
p_playlist
,
p_item
->
p_input
->
i_id
,
pl_Locked
);
p_item
->
p_input
,
pl_Locked
);
it2
=
getNextVisibleItem
(
it
)
;
it
->
parent
()
->
removeChild
(
it
);
it
=
it2
;
...
...
modules/gui/wince/playlist.cpp
View file @
cc321882
...
...
@@ -700,7 +700,7 @@ void Playlist::UpdateItem( int i )
/**********************************************************************
* Private functions
**********************************************************************/
void
Playlist
::
DeleteItem
(
in
t
item
)
void
Playlist
::
DeleteItem
(
in
put_item_t
*
item
)
{
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
if
(
p_playlist
==
NULL
)
return
;
...
...
src/playlist/item.c
View file @
cc321882
...
...
@@ -218,12 +218,12 @@ int playlist_ItemRelease( playlist_item_t *p_item )
*
* Remove an input item when it appears from a root playlist item
* \param p_playlist playlist object
* \param
i_input_id id of
the input to delete
* \param
p_input
the input to delete
* \param p_root root playlist item
* \param b_do_stop must stop or not the playlist
* \return VLC_SUCCESS or VLC_EGENERIC
*/
static
int
DeleteFromInput
(
playlist_t
*
p_playlist
,
in
t
i_input_id
,
static
int
DeleteFromInput
(
playlist_t
*
p_playlist
,
in
put_item_t
*
p_input
,
playlist_item_t
*
p_root
,
bool
b_do_stop
)
{
int
i
;
...
...
@@ -231,14 +231,14 @@ static int DeleteFromInput( playlist_t *p_playlist, int i_input_id,
for
(
i
=
0
;
i
<
p_root
->
i_children
;
i
++
)
{
if
(
p_root
->
pp_children
[
i
]
->
i_children
==
-
1
&&
p_root
->
pp_children
[
i
]
->
p_input
->
i_id
==
i_input_id
)
p_root
->
pp_children
[
i
]
->
p_input
==
p_input
)
{
DeleteInner
(
p_playlist
,
p_root
->
pp_children
[
i
],
b_do_stop
);
return
VLC_SUCCESS
;
}
else
if
(
p_root
->
pp_children
[
i
]
->
i_children
>=
0
)
{
int
i_ret
=
DeleteFromInput
(
p_playlist
,
i_input_id
,
int
i_ret
=
DeleteFromInput
(
p_playlist
,
p_input
,
p_root
->
pp_children
[
i
],
b_do_stop
);
if
(
i_ret
==
VLC_SUCCESS
)
return
VLC_SUCCESS
;
}
...
...
@@ -251,18 +251,18 @@ static int DeleteFromInput( playlist_t *p_playlist, int i_input_id,
*
* Remove an input item when it appears from a root playlist item
* \param p_playlist playlist object
* \param
i_input_id id of
the input to delete
* \param
p_input
the input to delete
* \param p_root root playlist item
* \param b_locked TRUE if the playlist is locked
* \return VLC_SUCCESS or VLC_EGENERIC
*/
int
playlist_DeleteFromInputInParent
(
playlist_t
*
p_playlist
,
int
i_input_id
,
int
playlist_DeleteFromInputInParent
(
playlist_t
*
p_playlist
,
input_item_t
*
p_item
,
playlist_item_t
*
p_root
,
bool
b_locked
)
{
int
i_ret
;
PL_LOCK_IF
(
!
b_locked
);
i_ret
=
DeleteFromInput
(
p_playlist
,
i_input_id
,
p_root
,
true
);
i_ret
=
DeleteFromInput
(
p_playlist
,
p_item
,
p_root
,
true
);
PL_UNLOCK_IF
(
!
b_locked
);
return
i_ret
;
}
...
...
@@ -272,18 +272,18 @@ int playlist_DeleteFromInputInParent( playlist_t *p_playlist, int i_input_id,
*
* Remove an input item from ONELEVEL and CATEGORY
* \param p_playlist playlist object
* \param
i_input_id id of
the input to delete
* \param
p_input
the input to delete
* \param b_locked TRUE if the playlist is locked
* \return VLC_SUCCESS or VLC_ENOITEM
*/
int
playlist_DeleteFromInput
(
playlist_t
*
p_playlist
,
in
t
i_input_id
,
int
playlist_DeleteFromInput
(
playlist_t
*
p_playlist
,
in
put_item_t
*
p_input
,
bool
b_locked
)
{
int
i_ret1
,
i_ret2
;
PL_LOCK_IF
(
!
b_locked
);
i_ret1
=
DeleteFromInput
(
p_playlist
,
i_input_id
,
i_ret1
=
DeleteFromInput
(
p_playlist
,
p_input
,
p_playlist
->
p_root_category
,
true
);
i_ret2
=
DeleteFromInput
(
p_playlist
,
i_input_id
,
i_ret2
=
DeleteFromInput
(
p_playlist
,
p_input
,
p_playlist
->
p_root_onelevel
,
true
);
PL_UNLOCK_IF
(
!
b_locked
);
return
(
i_ret1
==
VLC_SUCCESS
||
i_ret2
==
VLC_SUCCESS
)
?
...
...
@@ -620,7 +620,7 @@ static playlist_item_t *ItemToNode( playlist_t *p_playlist,
if
(
p_prev_status_item
)
set_current_status_item
(
p_playlist
,
p_prev_status_item
);
}
DeleteFromInput
(
p_playlist
,
p_item_in_one
->
p_input
->
i_id
,
DeleteFromInput
(
p_playlist
,
p_item_in_one
->
p_input
,
p_playlist
->
p_root_onelevel
,
false
);
}
pl_priv
(
p_playlist
)
->
b_reset_currently_playing
=
true
;
...
...
src/playlist/playlist_internal.h
View file @
cc321882
...
...
@@ -138,7 +138,8 @@ playlist_item_t *playlist_ItemFindFromInputAndRoot( playlist_t *p_playlist,
int
i_input_id
,
playlist_item_t
*
p_root
,
bool
);
int
playlist_DeleteFromInputInParent
(
playlist_t
*
,
int
,
playlist_item_t
*
,
bool
);
int
playlist_DeleteFromInputInParent
(
playlist_t
*
,
input_item_t
*
,
playlist_item_t
*
,
bool
);
int
playlist_DeleteFromItemId
(
playlist_t
*
,
int
);
int
playlist_ItemRelease
(
playlist_item_t
*
);
...
...
src/playlist/services_discovery.c
View file @
cc321882
...
...
@@ -219,7 +219,7 @@ static void playlist_sd_item_removed( const vlc_event_t * p_event, void * user_d
playlist_NodeDelete
(
p_parent
->
p_playlist
,
p_pl_item
,
true
,
false
);
else
/* Delete the non-node item normally */
playlist_DeleteFromInputInParent
(
p_parent
->
p_playlist
,
p_input
->
i_id
,
playlist_DeleteFromInputInParent
(
p_parent
->
p_playlist
,
p_input
,
p_parent
,
pl_Locked
);
playlist_Unlock
(
p_parent
->
p_playlist
);
...
...
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