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
bd70c3b4
Commit
bd70c3b4
authored
Jul 01, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rss: factorize.
parent
22507d75
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
25 deletions
+16
-25
modules/video_filter/rss.c
modules/video_filter/rss.c
+16
-25
No files found.
modules/video_filter/rss.c
View file @
bd70c3b4
...
@@ -236,6 +236,7 @@ static int CreateFilter( vlc_object_t *p_this )
...
@@ -236,6 +236,7 @@ static int CreateFilter( vlc_object_t *p_this )
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
;
filter_sys_t
*
p_sys
;
int
i_feed
;
int
i_feed
;
int
i_ret
=
VLC_ENOMEM
;
/* Allocate structure */
/* Allocate structure */
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
filter_sys_t
)
);
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
filter_sys_t
)
);
...
@@ -257,23 +258,14 @@ static int CreateFilter( vlc_object_t *p_this )
...
@@ -257,23 +258,14 @@ static int CreateFilter( vlc_object_t *p_this )
p_sys
->
i_ttl
=
__MAX
(
0
,
var_CreateGetInteger
(
p_filter
,
CFG_PREFIX
"ttl"
)
);
p_sys
->
i_ttl
=
__MAX
(
0
,
var_CreateGetInteger
(
p_filter
,
CFG_PREFIX
"ttl"
)
);
p_sys
->
b_images
=
var_CreateGetBool
(
p_filter
,
CFG_PREFIX
"images"
);
p_sys
->
b_images
=
var_CreateGetBool
(
p_filter
,
CFG_PREFIX
"images"
);
p_sys
->
psz_marquee
=
(
char
*
)
malloc
(
p_sys
->
i_length
+
1
);
p_sys
->
psz_marquee
=
malloc
(
p_sys
->
i_length
+
1
);
if
(
p_sys
->
psz_marquee
==
NULL
)
if
(
p_sys
->
psz_marquee
==
NULL
)
{
goto
error
;
free
(
p_sys
->
psz_urls
);
free
(
p_sys
);
return
VLC_ENOMEM
;
}
p_sys
->
psz_marquee
[
p_sys
->
i_length
]
=
'\0'
;
p_sys
->
psz_marquee
[
p_sys
->
i_length
]
=
'\0'
;
p_sys
->
p_style
=
text_style_New
();
p_sys
->
p_style
=
text_style_New
();
if
(
p_sys
->
p_style
==
NULL
)
if
(
p_sys
->
p_style
==
NULL
)
{
goto
error
;
free
(
p_sys
->
psz_marquee
);
free
(
p_sys
->
psz_urls
);
free
(
p_sys
);
return
VLC_ENOMEM
;
}
p_sys
->
i_xoff
=
var_CreateGetInteger
(
p_filter
,
CFG_PREFIX
"x"
);
p_sys
->
i_xoff
=
var_CreateGetInteger
(
p_filter
,
CFG_PREFIX
"x"
);
p_sys
->
i_yoff
=
var_CreateGetInteger
(
p_filter
,
CFG_PREFIX
"y"
);
p_sys
->
i_yoff
=
var_CreateGetInteger
(
p_filter
,
CFG_PREFIX
"y"
);
...
@@ -291,39 +283,38 @@ static int CreateFilter( vlc_object_t *p_this )
...
@@ -291,39 +283,38 @@ static int CreateFilter( vlc_object_t *p_this )
{
{
msg_Err
(
p_filter
,
"failed while fetching RSS ... too bad"
);
msg_Err
(
p_filter
,
"failed while fetching RSS ... too bad"
);
text_style_Delete
(
p_sys
->
p_style
);
text_style_Delete
(
p_sys
->
p_style
);
free
(
p_sys
->
psz_marquee
);
i_ret
=
VLC_EGENERIC
;
free
(
p_sys
->
psz_urls
);
goto
error
;
free
(
p_sys
);
return
VLC_EGENERIC
;
}
}
p_sys
->
t_last_update
=
time
(
NULL
);
p_sys
->
t_last_update
=
time
(
NULL
);
if
(
p_sys
->
i_feeds
==
0
)
if
(
p_sys
->
i_feeds
==
0
)
{
{
text_style_Delete
(
p_sys
->
p_style
);
text_style_Delete
(
p_sys
->
p_style
);
free
(
p_sys
->
psz_marquee
);
i_ret
=
VLC_EGENERIC
;
free
(
p_sys
->
psz_urls
);
goto
error
;
free
(
p_sys
);
return
VLC_EGENERIC
;
}
}
for
(
i_feed
=
0
;
i_feed
<
p_sys
->
i_feeds
;
i_feed
++
)
for
(
i_feed
=
0
;
i_feed
<
p_sys
->
i_feeds
;
i_feed
++
)
{
{
if
(
p_sys
->
p_feeds
[
i_feed
].
i_items
==
0
)
if
(
p_sys
->
p_feeds
[
i_feed
].
i_items
==
0
)
{
{
text_style_Delete
(
p_sys
->
p_style
);
DestroyFilter
(
p_this
);
free
(
p_sys
->
psz_marquee
);
FreeRSS
(
p_filter
);
free
(
p_sys
->
psz_urls
);
free
(
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
}
}
/* Misc init */
/* Misc init */
vlc_mutex_init
(
&
p_sys
->
lock
);
vlc_mutex_init
(
&
p_sys
->
lock
);
p_filter
->
pf_sub_filter
=
Filter
;
p_filter
->
pf_sub_filter
=
Filter
;
p_sys
->
last_date
=
(
mtime_t
)
0
;
p_sys
->
last_date
=
(
mtime_t
)
0
;
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
error:
free
(
p_sys
->
psz_marquee
);
free
(
p_sys
->
psz_urls
);
free
(
p_sys
);
return
i_ret
;
}
}
/*****************************************************************************
/*****************************************************************************
* DestroyFilter: destroy RSS video filter
* DestroyFilter: destroy RSS video filter
...
...
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