Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
d79bd604
Commit
d79bd604
authored
Mar 31, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: factorize freeing a link
parent
1dd35611
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
23 deletions
+21
-23
avfilter.c
libavfilter/avfilter.c
+21
-23
No files found.
libavfilter/avfilter.c
View file @
d79bd604
...
@@ -428,42 +428,40 @@ int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *in
...
@@ -428,42 +428,40 @@ int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *in
}
}
#endif
#endif
void
avfilter_free
(
AVFilterContext
*
filter
)
static
void
free_link
(
AVFilterLink
*
link
)
{
{
int
i
;
if
(
!
link
)
AVFilterLink
*
link
;
return
;
if
(
filter
->
graph
)
ff_filter_graph_remove_filter
(
filter
->
graph
,
filter
);
if
(
filter
->
filter
->
uninit
)
filter
->
filter
->
uninit
(
filter
);
for
(
i
=
0
;
i
<
filter
->
nb_inputs
;
i
++
)
{
if
((
link
=
filter
->
inputs
[
i
]))
{
if
(
link
->
src
)
if
(
link
->
src
)
link
->
src
->
outputs
[
link
->
srcpad
-
link
->
src
->
output_pads
]
=
NULL
;
link
->
src
->
outputs
[
link
->
srcpad
-
link
->
src
->
output_pads
]
=
NULL
;
ff_formats_unref
(
&
link
->
in_formats
);
ff_formats_unref
(
&
link
->
out_formats
);
ff_formats_unref
(
&
link
->
in_samplerates
);
ff_formats_unref
(
&
link
->
out_samplerates
);
ff_channel_layouts_unref
(
&
link
->
in_channel_layouts
);
ff_channel_layouts_unref
(
&
link
->
out_channel_layouts
);
}
av_freep
(
&
link
);
}
for
(
i
=
0
;
i
<
filter
->
nb_outputs
;
i
++
)
{
if
((
link
=
filter
->
outputs
[
i
]))
{
if
(
link
->
dst
)
if
(
link
->
dst
)
link
->
dst
->
inputs
[
link
->
dstpad
-
link
->
dst
->
input_pads
]
=
NULL
;
link
->
dst
->
inputs
[
link
->
dstpad
-
link
->
dst
->
input_pads
]
=
NULL
;
ff_formats_unref
(
&
link
->
in_formats
);
ff_formats_unref
(
&
link
->
in_formats
);
ff_formats_unref
(
&
link
->
out_formats
);
ff_formats_unref
(
&
link
->
out_formats
);
ff_formats_unref
(
&
link
->
in_samplerates
);
ff_formats_unref
(
&
link
->
in_samplerates
);
ff_formats_unref
(
&
link
->
out_samplerates
);
ff_formats_unref
(
&
link
->
out_samplerates
);
ff_channel_layouts_unref
(
&
link
->
in_channel_layouts
);
ff_channel_layouts_unref
(
&
link
->
in_channel_layouts
);
ff_channel_layouts_unref
(
&
link
->
out_channel_layouts
);
ff_channel_layouts_unref
(
&
link
->
out_channel_layouts
);
}
av_freep
(
&
link
);
av_freep
(
&
link
);
}
void
avfilter_free
(
AVFilterContext
*
filter
)
{
int
i
;
if
(
filter
->
graph
)
ff_filter_graph_remove_filter
(
filter
->
graph
,
filter
);
if
(
filter
->
filter
->
uninit
)
filter
->
filter
->
uninit
(
filter
);
for
(
i
=
0
;
i
<
filter
->
nb_inputs
;
i
++
)
{
free_link
(
filter
->
inputs
[
i
]);
}
for
(
i
=
0
;
i
<
filter
->
nb_outputs
;
i
++
)
{
free_link
(
filter
->
outputs
[
i
]);
}
}
if
(
filter
->
filter
->
priv_class
)
if
(
filter
->
filter
->
priv_class
)
...
...
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