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
26af1ac0
Commit
26af1ac0
authored
Jan 31, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services_discovery: no need to attach to events twice
parent
23f2edd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
42 deletions
+5
-42
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+5
-42
No files found.
src/playlist/services_discovery.c
View file @
26af1ac0
...
...
@@ -235,7 +235,7 @@ static void playlist_sd_item_added( const vlc_event_t * p_event, void * user_dat
{
input_item_t
*
p_input
=
p_event
->
u
.
services_discovery_item_added
.
p_new_item
;
const
char
*
psz_cat
=
p_event
->
u
.
services_discovery_item_added
.
psz_category
;
playlist_item_t
*
p_new_item
,
*
p_parent
=
user_data
;
playlist_item_t
*
p_parent
=
user_data
;
playlist_t
*
p_playlist
=
p_parent
->
p_playlist
;
msg_Dbg
(
p_playlist
,
"Adding %s in %s"
,
...
...
@@ -259,13 +259,9 @@ static void playlist_sd_item_added( const vlc_event_t * p_event, void * user_dat
p_parent
=
p_cat
;
}
p_new_item
=
playlist_NodeAddInput
(
p_playlist
,
p_input
,
p_parent
,
PLAYLIST_APPEND
,
PLAYLIST_END
,
pl_Locked
);
if
(
p_new_item
)
{
p_new_item
->
i_flags
&=
~
PLAYLIST_SKIP_FLAG
;
p_new_item
->
i_flags
&=
~
PLAYLIST_SAVE_FLAG
;
}
playlist_BothAddInput
(
p_playlist
,
p_input
,
p_parent
,
PLAYLIST_APPEND
,
PLAYLIST_END
,
NULL
,
NULL
,
pl_Locked
);
PL_UNLOCK
;
}
...
...
@@ -274,22 +270,7 @@ static void playlist_sd_item_removed( const vlc_event_t * p_event, void * user_d
{
input_item_t
*
p_input
=
p_event
->
u
.
services_discovery_item_removed
.
p_item
;
playlist_item_t
*
p_parent
=
user_data
;
playlist_item_t
*
p_pl_item
;
/* First make sure that if item is a node it will be deleted.
* XXX: Why don't we have a function to ensure that in the playlist code ? */
playlist_Lock
(
p_parent
->
p_playlist
);
p_pl_item
=
playlist_ItemFindFromInputAndRoot
(
p_parent
->
p_playlist
,
p_input
,
p_parent
,
false
);
if
(
p_pl_item
&&
p_pl_item
->
i_children
>
-
1
)
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
,
p_parent
,
pl_Locked
);
playlist_Unlock
(
p_parent
->
p_playlist
);
playlist_DeleteFromInput
(
p_parent
->
p_playlist
,
p_input
,
false
);
}
int
playlist_ServicesDiscoveryAdd
(
playlist_t
*
p_playlist
,
const
char
*
psz_module
)
...
...
@@ -327,18 +308,10 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modul
PL_UNLOCK
;
module_release
(
m
);
vlc_event_attach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemAdded
,
playlist_sd_item_added
,
p_one
);
vlc_event_attach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemAdded
,
playlist_sd_item_added
,
p_cat
);
vlc_event_attach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemRemoved
,
playlist_sd_item_removed
,
p_one
);
vlc_event_attach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemRemoved
,
playlist_sd_item_removed
,
p_cat
);
...
...
@@ -393,21 +366,11 @@ int playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
vlc_sd_Stop
(
p_sd
);
vlc_event_detach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemAdded
,
playlist_sd_item_added
,
p_sds
->
p_one
);
vlc_event_detach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemAdded
,
playlist_sd_item_added
,
p_sds
->
p_cat
);
vlc_event_detach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemRemoved
,
playlist_sd_item_removed
,
p_sds
->
p_one
);
vlc_event_detach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemRemoved
,
playlist_sd_item_removed
,
...
...
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