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
b904c184
Commit
b904c184
authored
Feb 23, 2010
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sd: Factorize function dispatch for better code readability.
parent
fcd847ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
21 deletions
+17
-21
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+17
-21
No files found.
src/playlist/services_discovery.c
View file @
b904c184
...
...
@@ -93,14 +93,6 @@ char **vlc_sd_GetNames (vlc_object_t *obj, char ***pppsz_longnames, int **pp_cat
}
struct
vlc_sd_internal_t
{
/* the playlist items for category and onelevel */
playlist_item_t
*
p_node
;
services_discovery_t
*
p_sd
;
/**< Loaded service discovery modules */
char
*
psz_name
;
};
static
void
services_discovery_Destructor
(
vlc_object_t
*
p_obj
);
/*
...
...
@@ -124,15 +116,12 @@ services_discovery_t *vlc_sd_Create( vlc_object_t *p_super,
return
NULL
;
free
(
config_ChainCreate
(
&
p_sd
->
psz_name
,
&
p_sd
->
p_cfg
,
cfg
));
vlc_event_manager_init
(
&
p_sd
->
event_manager
,
p_sd
,
(
vlc_object_t
*
)
p_sd
);
vlc_event_manager_register_event_type
(
&
p_sd
->
event_manager
,
vlc_ServicesDiscoveryItemAdded
);
vlc_event_manager_register_event_type
(
&
p_sd
->
event_manager
,
vlc_ServicesDiscoveryItemRemoved
);
vlc_event_manager_register_event_type
(
&
p_sd
->
event_manager
,
vlc_ServicesDiscoveryStarted
);
vlc_event_manager_register_event_type
(
&
p_sd
->
event_manager
,
vlc_ServicesDiscoveryEnded
);
vlc_event_manager_t
*
em
=
&
p_sd
->
event_manager
;
vlc_event_manager_init
(
em
,
p_sd
,
(
vlc_object_t
*
)
p_sd
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryItemAdded
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryItemRemoved
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryStarted
);
vlc_event_manager_register_event_type
(
em
,
vlc_ServicesDiscoveryEnded
);
vlc_object_set_destructor
(
p_sd
,
services_discovery_Destructor
);
vlc_object_attach
(
p_sd
,
p_super
);
...
...
@@ -244,6 +233,14 @@ services_discovery_RemoveItem ( services_discovery_t * p_sd, input_item_t * p_it
* Playlist - Services discovery bridge
*/
struct
vlc_sd_internal_t
{
/* the playlist items for category and onelevel */
playlist_item_t
*
p_node
;
services_discovery_t
*
p_sd
;
/**< Loaded service discovery modules */
char
*
psz_name
;
};
/* A new item has been added to a certain sd */
static
void
playlist_sd_item_added
(
const
vlc_event_t
*
p_event
,
void
*
user_data
)
{
...
...
@@ -345,12 +342,11 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist,
p_playlist
->
p_root
,
0
,
NULL
);
PL_UNLOCK
;
vlc_event_
attach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemAdded
,
vlc_event_
manager_t
*
em
=
services_discovery_EventManager
(
p_sd
);
vlc_event_attach
(
em
,
vlc_ServicesDiscoveryItemAdded
,
playlist_sd_item_added
,
p_node
);
vlc_event_attach
(
services_discovery_EventManager
(
p_sd
),
vlc_ServicesDiscoveryItemRemoved
,
vlc_event_attach
(
em
,
vlc_ServicesDiscoveryItemRemoved
,
playlist_sd_item_removed
,
p_node
);
if
(
!
vlc_sd_Start
(
p_sd
)
)
...
...
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