Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
54e0d270
Commit
54e0d270
authored
Feb 15, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SD: remove category node when it becomes empty
parent
c8a67b80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+19
-2
No files found.
src/playlist/services_discovery.c
View file @
54e0d270
...
...
@@ -282,8 +282,25 @@ static void playlist_sd_item_added( const vlc_event_t * p_event, void * user_dat
static
void
playlist_sd_item_removed
(
const
vlc_event_t
*
p_event
,
void
*
user_data
)
{
input_item_t
*
p_input
=
p_event
->
u
.
services_discovery_item_removed
.
p_item
;
playlist_item_t
*
p_parent
=
user_data
;
playlist_DeleteFromInput
(
p_parent
->
p_playlist
,
p_input
,
false
);
playlist_item_t
*
p_sd_node
=
user_data
;
playlist_t
*
p_playlist
=
p_sd_node
->
p_playlist
;
PL_LOCK
;
playlist_item_t
*
p_item
=
playlist_ItemFindFromInputAndRoot
(
p_playlist
,
p_input
,
p_sd_node
,
false
);
if
(
!
p_item
)
{
PL_UNLOCK
;
return
;
}
playlist_item_t
*
p_parent
=
p_item
->
p_parent
;
/* 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_DeleteItem
(
p_playlist
,
p_item
,
true
);
else
playlist_NodeDelete
(
p_playlist
,
p_parent
,
true
,
true
);
PL_UNLOCK
;
}
int
playlist_ServicesDiscoveryAdd
(
playlist_t
*
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