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
e977ca26
Commit
e977ca26
authored
Jun 02, 2011
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi: add avfilter_link_free() function
Allow to free the buffers cached in each AVFilterLink pool. Fix leak.
parent
b932eb1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
3 deletions
+36
-3
APIchanges
doc/APIchanges
+3
-0
avfilter.c
libavfilter/avfilter.c
+27
-2
avfilter.h
libavfilter/avfilter.h
+6
-1
No files found.
doc/APIchanges
View file @
e977ca26
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
API changes, most recent first:
2011-06-03 - xxxxxx - lavfi 2.12.0 - avfilter_link_free()
Add avfilter_link_free() function.
2011-05-28 - xxxxxx - lavu 51.3.0 - pixdesc.h
2011-05-28 - xxxxxx - lavu 51.3.0 - pixdesc.h
Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
...
...
libavfilter/avfilter.c
View file @
e977ca26
...
@@ -165,6 +165,31 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
...
@@ -165,6 +165,31 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
return
0
;
return
0
;
}
}
void
avfilter_link_free
(
AVFilterLink
**
link
)
{
if
(
!*
link
)
return
;
if
((
*
link
)
->
pool
)
{
int
i
;
for
(
i
=
0
;
i
<
POOL_SIZE
;
i
++
)
{
if
((
*
link
)
->
pool
->
pic
[
i
])
{
AVFilterBufferRef
*
picref
=
(
*
link
)
->
pool
->
pic
[
i
];
/* free buffer: picrefs stored in the pool are not
* supposed to contain a free callback */
av_freep
(
&
picref
->
buf
->
data
[
0
]);
av_freep
(
&
picref
->
buf
);
av_freep
(
&
picref
->
audio
);
av_freep
(
&
picref
->
video
);
av_freep
(
&
picref
);
}
}
av_freep
(
&
(
*
link
)
->
pool
);
}
av_freep
(
link
);
}
int
avfilter_insert_filter
(
AVFilterLink
*
link
,
AVFilterContext
*
filt
,
int
avfilter_insert_filter
(
AVFilterLink
*
link
,
AVFilterContext
*
filt
,
unsigned
filt_srcpad_idx
,
unsigned
filt_dstpad_idx
)
unsigned
filt_srcpad_idx
,
unsigned
filt_dstpad_idx
)
{
{
...
@@ -683,7 +708,7 @@ void avfilter_free(AVFilterContext *filter)
...
@@ -683,7 +708,7 @@ void avfilter_free(AVFilterContext *filter)
avfilter_formats_unref
(
&
link
->
in_formats
);
avfilter_formats_unref
(
&
link
->
in_formats
);
avfilter_formats_unref
(
&
link
->
out_formats
);
avfilter_formats_unref
(
&
link
->
out_formats
);
}
}
av
_freep
(
&
link
);
av
filter_link_free
(
&
link
);
}
}
for
(
i
=
0
;
i
<
filter
->
output_count
;
i
++
)
{
for
(
i
=
0
;
i
<
filter
->
output_count
;
i
++
)
{
if
((
link
=
filter
->
outputs
[
i
]))
{
if
((
link
=
filter
->
outputs
[
i
]))
{
...
@@ -692,7 +717,7 @@ void avfilter_free(AVFilterContext *filter)
...
@@ -692,7 +717,7 @@ void avfilter_free(AVFilterContext *filter)
avfilter_formats_unref
(
&
link
->
in_formats
);
avfilter_formats_unref
(
&
link
->
in_formats
);
avfilter_formats_unref
(
&
link
->
out_formats
);
avfilter_formats_unref
(
&
link
->
out_formats
);
}
}
av
_freep
(
&
link
);
av
filter_link_free
(
&
link
);
}
}
av_freep
(
&
filter
->
name
);
av_freep
(
&
filter
->
name
);
...
...
libavfilter/avfilter.h
View file @
e977ca26
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include "libavutil/samplefmt.h"
#include "libavutil/samplefmt.h"
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MAJOR 2
#define LIBAVFILTER_VERSION_MINOR 1
1
#define LIBAVFILTER_VERSION_MINOR 1
2
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_MICRO 0
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
...
@@ -635,6 +635,11 @@ struct AVFilterLink {
...
@@ -635,6 +635,11 @@ struct AVFilterLink {
int
avfilter_link
(
AVFilterContext
*
src
,
unsigned
srcpad
,
int
avfilter_link
(
AVFilterContext
*
src
,
unsigned
srcpad
,
AVFilterContext
*
dst
,
unsigned
dstpad
);
AVFilterContext
*
dst
,
unsigned
dstpad
);
/**
* Free the link in *link, and set its pointer to NULL.
*/
void
avfilter_link_free
(
AVFilterLink
**
link
);
/**
/**
* Negotiate the media format, dimensions, etc of all inputs to a filter.
* Negotiate the media format, dimensions, etc of all inputs to a 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