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
ed1879cb
Commit
ed1879cb
authored
Jul 29, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter_chain: inline filter_chain_DeleteFilter() and drop return value
parent
d6e6460d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
53 deletions
+40
-53
include/vlc_filter.h
include/vlc_filter.h
+1
-2
src/misc/filter_chain.c
src/misc/filter_chain.c
+39
-51
No files found.
include/vlc_filter.h
View file @
ed1879cb
...
...
@@ -363,9 +363,8 @@ VLC_API int filter_chain_AppendFromString( filter_chain_t *, const char * );
*
* \param p_chain pointer to filter chain
* \param p_filter pointer to filter object
* \return VLC_SUCCESS on succes, else VLC_EGENERIC
*/
VLC_API
int
filter_chain_DeleteFilter
(
filter_chain_t
*
,
filter_t
*
);
VLC_API
void
filter_chain_DeleteFilter
(
filter_chain_t
*
,
filter_t
*
);
/**
* Get the number of filters in the filter chain.
...
...
src/misc/filter_chain.c
View file @
ed1879cb
...
...
@@ -65,8 +65,6 @@ struct filter_chain_t
/**
* Local prototypes
*/
static
int
filter_chain_DeleteFilterInternal
(
filter_chain_t
*
,
filter_t
*
);
static
void
FilterDeletePictures
(
filter_t
*
,
picture_t
*
);
static
filter_chain_t
*
filter_chain_NewInner
(
const
filter_owner_t
*
callbacks
,
...
...
@@ -163,7 +161,7 @@ filter_chain_t *filter_chain_NewVideo( vlc_object_t *obj, bool allow_change,
void
filter_chain_Delete
(
filter_chain_t
*
p_chain
)
{
while
(
p_chain
->
first
!=
NULL
)
filter_chain_DeleteFilter
Internal
(
p_chain
,
&
p_chain
->
first
->
filter
);
filter_chain_DeleteFilter
(
p_chain
,
&
p_chain
->
first
->
filter
);
es_format_Clean
(
&
p_chain
->
fmt_in
);
es_format_Clean
(
&
p_chain
->
fmt_out
);
...
...
@@ -177,7 +175,7 @@ void filter_chain_Reset( filter_chain_t *p_chain, const es_format_t *p_fmt_in,
const
es_format_t
*
p_fmt_out
)
{
while
(
p_chain
->
first
!=
NULL
)
filter_chain_DeleteFilter
Internal
(
p_chain
,
&
p_chain
->
first
->
filter
);
filter_chain_DeleteFilter
(
p_chain
,
&
p_chain
->
first
->
filter
);
if
(
p_fmt_in
)
{
...
...
@@ -269,6 +267,42 @@ error:
return
NULL
;
}
void
filter_chain_DeleteFilter
(
filter_chain_t
*
chain
,
filter_t
*
filter
)
{
vlc_object_t
*
obj
=
chain
->
callbacks
.
sys
;
chained_filter_t
*
chained
=
(
chained_filter_t
*
)
filter
;
/* Remove it from the chain */
if
(
chained
->
prev
!=
NULL
)
chained
->
prev
->
next
=
chained
->
next
;
else
{
assert
(
chained
==
chain
->
first
);
chain
->
first
=
chained
->
next
;
}
if
(
chained
->
next
!=
NULL
)
chained
->
next
->
prev
=
chained
->
prev
;
else
{
assert
(
chained
==
chain
->
last
);
chain
->
last
=
chained
->
prev
;
}
assert
(
chain
->
length
>
0
);
chain
->
length
--
;
module_unneed
(
filter
,
filter
->
p_module
);
msg_Dbg
(
obj
,
"Filter %p removed from chain"
,
filter
);
FilterDeletePictures
(
&
chained
->
filter
,
chained
->
pending
);
free
(
chained
->
mouse
);
vlc_object_release
(
filter
);
/* FIXME: check fmt_in/fmt_out consitency */
}
int
filter_chain_AppendFromString
(
filter_chain_t
*
chain
,
const
char
*
str
)
{
vlc_object_t
*
obj
=
chain
->
callbacks
.
sys
;
...
...
@@ -306,21 +340,13 @@ int filter_chain_AppendFromString( filter_chain_t *chain, const char *str )
error:
while
(
ret
>
0
)
/* Unwind */
{
filter_chain_DeleteFilter
Internal
(
chain
,
&
chain
->
last
->
filter
);
filter_chain_DeleteFilter
(
chain
,
&
chain
->
last
->
filter
);
ret
--
;
}
free
(
buf
);
return
-
1
;
}
int
filter_chain_DeleteFilter
(
filter_chain_t
*
p_chain
,
filter_t
*
p_filter
)
{
const
int
i_ret
=
filter_chain_DeleteFilterInternal
(
p_chain
,
p_filter
);
if
(
i_ret
<
0
)
return
i_ret
;
return
VLC_SUCCESS
;
}
int
filter_chain_ForEach
(
filter_chain_t
*
chain
,
int
(
*
cb
)(
filter_t
*
,
void
*
),
void
*
opaque
)
{
...
...
@@ -492,44 +518,6 @@ int filter_chain_MouseEvent( filter_chain_t *p_chain,
}
/* Helpers */
static
int
filter_chain_DeleteFilterInternal
(
filter_chain_t
*
p_chain
,
filter_t
*
p_filter
)
{
vlc_object_t
*
obj
=
p_chain
->
callbacks
.
sys
;
chained_filter_t
*
p_chained
=
chained
(
p_filter
);
/* Remove it from the chain */
if
(
p_chained
->
prev
!=
NULL
)
p_chained
->
prev
->
next
=
p_chained
->
next
;
else
{
assert
(
p_chained
==
p_chain
->
first
);
p_chain
->
first
=
p_chained
->
next
;
}
if
(
p_chained
->
next
!=
NULL
)
p_chained
->
next
->
prev
=
p_chained
->
prev
;
else
{
assert
(
p_chained
==
p_chain
->
last
);
p_chain
->
last
=
p_chained
->
prev
;
}
p_chain
->
length
--
;
msg_Dbg
(
obj
,
"Filter %p removed from chain"
,
p_filter
);
FilterDeletePictures
(
&
p_chained
->
filter
,
p_chained
->
pending
);
if
(
p_filter
->
p_module
)
module_unneed
(
p_filter
,
p_filter
->
p_module
);
free
(
p_chained
->
mouse
);
vlc_object_release
(
p_filter
);
/* FIXME: check fmt_in/fmt_out consitency */
return
VLC_SUCCESS
;
}
static
void
FilterDeletePictures
(
filter_t
*
filter
,
picture_t
*
picture
)
{
while
(
picture
)
...
...
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