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
716d5bf2
Commit
716d5bf2
authored
Aug 18, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist/services_discovery.c: Handle removal of a service.
parent
38dbd37a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
16 deletions
+64
-16
include/vlc_playlist.h
include/vlc_playlist.h
+6
-2
src/playlist/engine.c
src/playlist/engine.c
+2
-2
src/playlist/services_discovery.c
src/playlist/services_discovery.c
+56
-12
No files found.
include/vlc_playlist.h
View file @
716d5bf2
...
...
@@ -192,8 +192,12 @@ struct playlist_t
int
i_last_playlist_id
;
/**< Last id to an item */
int
i_last_input_id
;
/**< Last id on an input */
services_discovery_t
**
pp_sds
;
/**< Loaded service discovery modules */
int
i_sds
;
/**< Number of service discovery modules */
struct
playlist_archived_services_discovery_t
{
services_discovery_t
*
p_sd
;
/* The service discovery module */
playlist_item_t
*
p_cat
;
/* Corresponding item in the category view */
playlist_item_t
*
p_one
;
/* Corresponding item in the one level view */
}
**
pp_asds
;
/**< Loaded service discovery modules */
int
i_asds
;
/**< Number of service discovery modules */
/* Predefined items */
playlist_item_t
*
p_root_category
;
/**< Root of category tree */
...
...
src/playlist/engine.c
View file @
716d5bf2
...
...
@@ -434,10 +434,10 @@ void playlist_LastLoop( playlist_t *p_playlist )
vout_Destroy
(
(
vout_thread_t
*
)
p_obj
);
}
while
(
p_playlist
->
i_sds
)
while
(
p_playlist
->
i_
a
sds
)
{
playlist_ServicesDiscoveryRemove
(
p_playlist
,
p_playlist
->
pp_
sds
[
0
]
->
psz_module
);
p_playlist
->
pp_
asds
[
0
]
->
p_sd
->
psz_module
);
}
playlist_MLDump
(
p_playlist
);
...
...
src/playlist/services_discovery.c
View file @
716d5bf2
...
...
@@ -33,7 +33,7 @@ static void RunSD( services_discovery_t *p_sd );
* sd's event manager.
* That's how the playlist get's Service Discovery information
*/
/***********************************************************************
* Create
***********************************************************************/
...
...
@@ -205,6 +205,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
;
printf
(
" Removind %s
\n
"
,
p_input
->
psz_name
);
playlist_DeleteInputInParent
(
p_parent
->
p_playlist
,
p_input
->
i_id
,
p_parent
,
VLC_FALSE
);
}
...
...
@@ -216,7 +217,10 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu
for
(;;)
{
playlist_item_t
*
p_cat
,
*
p_one
;
struct
playlist_archived_services_discovery_t
*
p_asd
;
playlist_item_t
*
p_cat
;
playlist_item_t
*
p_one
;
while
(
*
psz_parser
==
' '
||
*
psz_parser
==
':'
||
*
psz_parser
==
','
)
psz_parser
++
;
...
...
@@ -250,8 +254,10 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu
else
{
/* No name, just add at the top of the playlist */
PL_LOCK
;
p_cat
=
p_playlist
->
p_root_category
;
p_one
=
p_playlist
->
p_root_onelevel
;
PL_UNLOCK
;
}
vlc_event_attach
(
services_discovery_EventManager
(
p_sd
),
...
...
@@ -276,8 +282,14 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu
services_discovery_Start
(
p_sd
);
/* Free in playlist_ServicesDiscoveryRemove */
p_asd
=
malloc
(
sizeof
(
struct
playlist_archived_services_discovery_t
)
);
p_asd
->
p_sd
=
p_sd
;
p_asd
->
p_one
=
p_one
;
p_asd
->
p_cat
=
p_cat
;
PL_LOCK
;
TAB_APPEND
(
p_playlist
->
i_
sds
,
p_playlist
->
pp_sds
,
p_
sd
);
TAB_APPEND
(
p_playlist
->
i_
asds
,
p_playlist
->
pp_asds
,
p_a
sd
);
PL_UNLOCK
;
}
...
...
@@ -288,23 +300,55 @@ int playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
const
char
*
psz_module
)
{
int
i
;
s
ervices_discovery_t
*
p_
sd
=
NULL
;
s
truct
playlist_archived_services_discovery_t
*
p_a
sd
=
NULL
;
PL_LOCK
;
for
(
i
=
0
;
i
<
p_playlist
->
i_sds
;
i
++
)
for
(
i
=
0
;
i
<
p_playlist
->
i_
a
sds
;
i
++
)
{
if
(
!
strcmp
(
psz_module
,
p_playlist
->
pp_
sds
[
i
]
->
psz_module
)
)
if
(
!
strcmp
(
psz_module
,
p_playlist
->
pp_
asds
[
i
]
->
p_sd
->
psz_module
)
)
{
p_
sd
=
p_playlist
->
pp_
sds
[
i
];
REMOVE_ELEM
(
p_playlist
->
pp_
sds
,
p_playlist
->
i_
sds
,
i
);
p_
asd
=
p_playlist
->
pp_a
sds
[
i
];
REMOVE_ELEM
(
p_playlist
->
pp_
asds
,
p_playlist
->
i_a
sds
,
i
);
break
;
}
}
PL_UNLOCK
;
if
(
p_sd
)
if
(
p_
asd
&&
p_asd
->
p_
sd
)
{
services_discovery_Destroy
(
p_sd
);
services_discovery_Destroy
(
p_asd
->
p_sd
);
vlc_event_detach
(
services_discovery_EventManager
(
p_asd
->
p_sd
),
vlc_ServicesDiscoveryItemAdded
,
playlist_sd_item_added
,
p_asd
->
p_one
);
vlc_event_detach
(
services_discovery_EventManager
(
p_asd
->
p_sd
),
vlc_ServicesDiscoveryItemAdded
,
playlist_sd_item_added
,
p_asd
->
p_cat
);
vlc_event_detach
(
services_discovery_EventManager
(
p_asd
->
p_sd
),
vlc_ServicesDiscoveryItemRemoved
,
playlist_sd_item_removed
,
p_asd
->
p_one
);
vlc_event_detach
(
services_discovery_EventManager
(
p_asd
->
p_sd
),
vlc_ServicesDiscoveryItemRemoved
,
playlist_sd_item_removed
,
p_asd
->
p_cat
);
/* Remove the sd playlist node if it exists */
PL_LOCK
;
if
(
p_asd
->
p_cat
!=
p_playlist
->
p_root_category
&&
p_asd
->
p_one
!=
p_playlist
->
p_root_onelevel
)
{
playlist_NodeDelete
(
p_playlist
,
p_asd
->
p_cat
,
VLC_TRUE
,
VLC_FALSE
);
playlist_NodeDelete
(
p_playlist
,
p_asd
->
p_one
,
VLC_TRUE
,
VLC_FALSE
);
}
PL_UNLOCK
;
free
(
p_asd
);
}
else
{
...
...
@@ -320,9 +364,9 @@ vlc_bool_t playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist,
int
i
;
PL_LOCK
;
for
(
i
=
0
;
i
<
p_playlist
->
i_sds
;
i
++
)
for
(
i
=
0
;
i
<
p_playlist
->
i_
a
sds
;
i
++
)
{
if
(
!
strcmp
(
psz_module
,
p_playlist
->
pp_
sds
[
i
]
->
psz_module
)
)
if
(
!
strcmp
(
psz_module
,
p_playlist
->
pp_
asds
[
i
]
->
p_sd
->
psz_module
)
)
{
PL_UNLOCK
;
return
VLC_TRUE
;
...
...
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