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
093c50a4
Commit
093c50a4
authored
May 14, 2012
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avprobe: close opened codecs after use
Fixes "memleak" on closing avprobe to make valgrind happy.
parent
100c70b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
avprobe.c
avprobe.c
+15
-1
No files found.
avprobe.c
View file @
093c50a4
...
...
@@ -352,6 +352,20 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
return
0
;
}
static
void
close_input_file
(
AVFormatContext
**
ctx_ptr
)
{
int
i
;
AVFormatContext
*
fmt_ctx
=
*
ctx_ptr
;
/* close decoder for each stream */
for
(
i
=
0
;
i
<
fmt_ctx
->
nb_streams
;
i
++
)
{
AVStream
*
stream
=
fmt_ctx
->
streams
[
i
];
avcodec_close
(
stream
->
codec
);
}
avformat_close_input
(
ctx_ptr
);
}
static
int
probe_file
(
const
char
*
filename
)
{
AVFormatContext
*
fmt_ctx
;
...
...
@@ -370,7 +384,7 @@ static int probe_file(const char *filename)
if
(
do_show_format
)
show_format
(
fmt_ctx
);
avformat_close_input
(
&
fmt_ctx
);
close_input_file
(
&
fmt_ctx
);
return
0
;
}
...
...
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