Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b86c36e6
Commit
b86c36e6
authored
Aug 18, 2007
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modules/services_discovery/podcast.c: Use the new API.
parent
3d041f13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
80 deletions
+45
-80
modules/services_discovery/podcast.c
modules/services_discovery/podcast.c
+45
-80
No files found.
modules/services_discovery/podcast.c
View file @
b86c36e6
...
...
@@ -78,8 +78,6 @@ vlc_module_end();
struct
services_discovery_sys_t
{
/* playlist node */
playlist_item_t
*
p_node_cat
;
playlist_item_t
*
p_node_one
;
input_thread_t
**
pp_input
;
char
**
ppsz_urls
;
...
...
@@ -101,10 +99,49 @@ static int Open( vlc_object_t *p_this )
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
p_this
;
services_discovery_sys_t
*
p_sys
=
malloc
(
sizeof
(
services_discovery_sys_t
)
);
p_sys
->
i_urls
=
0
;
p_sys
->
ppsz_urls
=
NULL
;
p_sys
->
pp_input
=
NULL
;
p_sd
->
pf_run
=
Run
;
p_sd
->
p_sys
=
p_sys
;
/* Give us a name */
services_discovery_SetLocalizedName
(
p_sd
,
_
(
"Podcasts"
)
);
vlc_value_t
val
;
playlist_t
*
p_playlist
;
playlist_item_t
*
p_item
;
return
VLC_SUCCESS
;
}
/*****************************************************************************
* Close:
*****************************************************************************/
static
void
Close
(
vlc_object_t
*
p_this
)
{
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
p_this
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
int
i
;
for
(
i
=
0
;
i
<
p_sys
->
i_urls
;
i
++
)
{
if
(
p_sd
->
p_sys
->
pp_input
[
i
]
)
{
input_StopThread
(
p_sd
->
p_sys
->
pp_input
[
i
]
);
input_DestroyThread
(
p_sd
->
p_sys
->
pp_input
[
i
]
);
p_sd
->
p_sys
->
pp_input
[
i
]
=
NULL
;
}
}
free
(
p_sd
->
p_sys
->
pp_input
);
for
(
i
=
0
;
i
<
p_sys
->
i_urls
;
i
++
)
free
(
p_sys
->
ppsz_urls
[
i
]
);
free
(
p_sys
->
ppsz_urls
);
free
(
p_sys
);
}
/*****************************************************************************
* Run: main thread
*****************************************************************************/
static
void
Run
(
services_discovery_t
*
p_sd
)
{
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
int
i
,
j
;
char
*
psz_buf
;
...
...
@@ -136,90 +173,18 @@ static int Open( vlc_object_t *p_this )
p_sys
->
ppsz_urls
[
j
]
=
strdup
(
psz_tmp
);
free
(
psz_buf
);
p_sd
->
pf_run
=
Run
;
p_sd
->
p_sys
=
p_sys
;
/* Create our playlist node */
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_sd
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
!
p_playlist
)
{
msg_Warn
(
p_sd
,
"unable to find playlist, cancelling"
);
return
VLC_EGENERIC
;
}
p_sys
->
p_node_cat
=
playlist_NodeCreate
(
p_playlist
,
_
(
"Podcast"
),
p_playlist
->
p_root_category
,
0
);
p_sys
->
p_node_one
=
playlist_NodeCreate
(
p_playlist
,
_
(
"Podcast"
),
p_playlist
->
p_root_onelevel
,
0
);
p_sys
->
p_node_one
->
p_input
->
i_id
=
p_sys
->
p_node_cat
->
p_input
->
i_id
;
p_sys
->
p_node_one
->
i_flags
|=
PLAYLIST_RO_FLAG
;
p_sys
->
p_node_cat
->
i_flags
|=
PLAYLIST_RO_FLAG
;
p_sys
->
p_node_one
->
i_flags
|=
PLAYLIST_SKIP_FLAG
;
p_sys
->
p_node_cat
->
i_flags
|=
PLAYLIST_SKIP_FLAG
;
p_sys
->
pp_input
=
malloc
(
p_sys
->
i_urls
*
sizeof
(
input_thread_t
*
)
);
for
(
i
=
0
;
i
<
p_sys
->
i_urls
;
i
++
)
{
input_item_t
*
p_input
;
asprintf
(
&
psz_buf
,
"%s"
,
p_sys
->
ppsz_urls
[
i
]
);
p_input
=
input_ItemNewExt
(
p_
playlist
,
psz_buf
,
p_input
=
input_ItemNewExt
(
p_
sd
,
psz_buf
,
p_sys
->
ppsz_urls
[
i
],
0
,
NULL
,
-
1
);
input_ItemAddOption
(
p_input
,
"demux=podcast"
);
p_item
=
playlist_NodeAddInput
(
p_playlist
,
p_input
,
p_sys
->
p_node_cat
,
PLAYLIST_APPEND
,
PLAYLIST_END
,
VLC_FALSE
);
p_item
=
playlist_NodeAddInput
(
p_playlist
,
p_input
,
p_sys
->
p_node_one
,
PLAYLIST_APPEND
,
PLAYLIST_END
,
VLC_FALSE
);
free
(
psz_buf
);
p_sys
->
pp_input
[
i
]
=
input_CreateThread
(
p_playlist
,
p_input
);
}
val
.
b_bool
=
VLC_TRUE
;
var_Set
(
p_playlist
,
"intf-change"
,
val
);
vlc_object_release
(
p_playlist
);
return
VLC_SUCCESS
;
}
/*****************************************************************************
* Close:
*****************************************************************************/
static
void
Close
(
vlc_object_t
*
p_this
)
{
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
p_this
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_sd
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
int
i
;
for
(
i
=
0
;
i
<
p_sys
->
i_urls
;
i
++
)
{
if
(
p_sd
->
p_sys
->
pp_input
[
i
]
)
{
input_StopThread
(
p_sd
->
p_sys
->
pp_input
[
i
]
);
input_DestroyThread
(
p_sd
->
p_sys
->
pp_input
[
i
]
);
p_sd
->
p_sys
->
pp_input
[
i
]
=
NULL
;
}
}
free
(
p_sd
->
p_sys
->
pp_input
);
if
(
p_playlist
)
{
playlist_NodeDelete
(
p_playlist
,
p_sys
->
p_node_cat
,
VLC_TRUE
,
VLC_TRUE
);
playlist_NodeDelete
(
p_playlist
,
p_sys
->
p_node_one
,
VLC_TRUE
,
VLC_TRUE
);
vlc_object_release
(
p_playlist
);
services_discovery_AddItem
(
p_sd
,
p_input
,
NULL
/* no cat */
);
p_sys
->
pp_input
[
i
]
=
input_CreateThread
(
p_sd
,
p_input
);
}
for
(
i
=
0
;
i
<
p_sys
->
i_urls
;
i
++
)
free
(
p_sys
->
ppsz_urls
[
i
]
);
free
(
p_sys
->
ppsz_urls
);
free
(
p_sys
);
}
/*****************************************************************************
* Run: main thread
*****************************************************************************/
static
void
Run
(
services_discovery_t
*
p_sd
)
{
while
(
!
p_sd
->
b_die
)
{
int
i
;
...
...
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