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
aeda1121
Commit
aeda1121
authored
Jul 20, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: factor out freeing an AVStream
It will be needed in other functions.
parent
3efd71b4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
25 deletions
+33
-25
utils.c
libavformat/utils.c
+33
-25
No files found.
libavformat/utils.c
View file @
aeda1121
...
@@ -2442,32 +2442,24 @@ int av_read_pause(AVFormatContext *s)
...
@@ -2442,32 +2442,24 @@ int av_read_pause(AVFormatContext *s)
return
AVERROR
(
ENOSYS
);
return
AVERROR
(
ENOSYS
);
}
}
void
avformat_free_context
(
AVFormatContext
*
s
)
static
void
free_stream
(
AVStream
**
pst
)
{
{
int
i
,
j
;
AVStream
*
st
=
*
pst
;
AVStream
*
st
;
int
i
;
if
(
!
s
)
if
(
!
s
t
)
return
;
return
;
av_opt_free
(
s
);
for
(
i
=
0
;
i
<
st
->
nb_side_data
;
i
++
)
if
(
s
->
iformat
&&
s
->
iformat
->
priv_class
&&
s
->
priv_data
)
av_freep
(
&
st
->
side_data
[
i
].
data
);
av_opt_free
(
s
->
priv_data
);
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
/* free all data in a stream component */
st
=
s
->
streams
[
i
];
for
(
j
=
0
;
j
<
st
->
nb_side_data
;
j
++
)
av_freep
(
&
st
->
side_data
[
j
].
data
);
av_freep
(
&
st
->
side_data
);
av_freep
(
&
st
->
side_data
);
st
->
nb_side_data
=
0
;
if
(
st
->
parser
)
{
if
(
st
->
parser
)
av_parser_close
(
st
->
parser
);
av_parser_close
(
st
->
parser
);
}
if
(
st
->
attached_pic
.
data
)
if
(
st
->
attached_pic
.
data
)
av_packet_unref
(
&
st
->
attached_pic
);
av_packet_unref
(
&
st
->
attached_pic
);
av_dict_free
(
&
st
->
metadata
);
av_dict_free
(
&
st
->
metadata
);
av_freep
(
&
st
->
probe_data
.
buf
);
av_freep
(
&
st
->
probe_data
.
buf
);
av_free
(
st
->
index_entries
);
av_free
(
st
->
index_entries
);
...
@@ -2476,8 +2468,24 @@ void avformat_free_context(AVFormatContext *s)
...
@@ -2476,8 +2468,24 @@ void avformat_free_context(AVFormatContext *s)
av_free
(
st
->
codec
);
av_free
(
st
->
codec
);
av_free
(
st
->
priv_data
);
av_free
(
st
->
priv_data
);
av_free
(
st
->
info
);
av_free
(
st
->
info
);
av_free
(
st
);
}
av_freep
(
pst
);
}
void
avformat_free_context
(
AVFormatContext
*
s
)
{
int
i
;
if
(
!
s
)
return
;
av_opt_free
(
s
);
if
(
s
->
iformat
&&
s
->
iformat
->
priv_class
&&
s
->
priv_data
)
av_opt_free
(
s
->
priv_data
);
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
free_stream
(
&
s
->
streams
[
i
]);
for
(
i
=
s
->
nb_programs
-
1
;
i
>=
0
;
i
--
)
{
for
(
i
=
s
->
nb_programs
-
1
;
i
>=
0
;
i
--
)
{
av_dict_free
(
&
s
->
programs
[
i
]
->
metadata
);
av_dict_free
(
&
s
->
programs
[
i
]
->
metadata
);
av_freep
(
&
s
->
programs
[
i
]
->
stream_index
);
av_freep
(
&
s
->
programs
[
i
]
->
stream_index
);
...
...
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