Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
85a57677
Commit
85a57677
authored
Aug 21, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: factor ff_free_stream() out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
3ac754b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
16 deletions
+23
-16
internal.h
libavformat/internal.h
+2
-0
utils.c
libavformat/utils.c
+21
-16
No files found.
libavformat/internal.h
View file @
85a57677
...
@@ -344,4 +344,6 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt);
...
@@ -344,4 +344,6 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt);
int
ff_interleave_packet_per_dts
(
AVFormatContext
*
s
,
AVPacket
*
out
,
int
ff_interleave_packet_per_dts
(
AVFormatContext
*
s
,
AVPacket
*
out
,
AVPacket
*
pkt
,
int
flush
);
AVPacket
*
pkt
,
int
flush
);
void
ff_free_stream
(
AVFormatContext
*
s
,
AVStream
*
st
);
#endif
/* AVFORMAT_INTERNAL_H */
#endif
/* AVFORMAT_INTERNAL_H */
libavformat/utils.c
View file @
85a57677
...
@@ -2996,6 +2996,25 @@ int av_read_pause(AVFormatContext *s)
...
@@ -2996,6 +2996,25 @@ int av_read_pause(AVFormatContext *s)
return
AVERROR
(
ENOSYS
);
return
AVERROR
(
ENOSYS
);
}
}
void
ff_free_stream
(
AVFormatContext
*
s
,
AVStream
*
st
){
av_assert0
(
s
->
nb_streams
>
0
);
av_assert0
(
s
->
streams
[
s
->
nb_streams
-
1
]
==
st
);
if
(
st
->
parser
)
{
av_parser_close
(
st
->
parser
);
}
if
(
st
->
attached_pic
.
data
)
av_free_packet
(
&
st
->
attached_pic
);
av_dict_free
(
&
st
->
metadata
);
av_freep
(
&
st
->
index_entries
);
av_freep
(
&
st
->
codec
->
extradata
);
av_freep
(
&
st
->
codec
->
subtitle_header
);
av_freep
(
&
st
->
codec
);
av_freep
(
&
st
->
priv_data
);
av_freep
(
&
st
->
info
);
av_freep
(
&
s
->
streams
[
--
s
->
nb_streams
]);
}
void
avformat_free_context
(
AVFormatContext
*
s
)
void
avformat_free_context
(
AVFormatContext
*
s
)
{
{
int
i
;
int
i
;
...
@@ -3005,22 +3024,8 @@ void avformat_free_context(AVFormatContext *s)
...
@@ -3005,22 +3024,8 @@ void avformat_free_context(AVFormatContext *s)
if
(
s
->
iformat
&&
s
->
iformat
->
priv_class
&&
s
->
priv_data
)
if
(
s
->
iformat
&&
s
->
iformat
->
priv_class
&&
s
->
priv_data
)
av_opt_free
(
s
->
priv_data
);
av_opt_free
(
s
->
priv_data
);
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
for
(
i
=
s
->
nb_streams
-
1
;
i
>=
0
;
i
--
)
{
/* free all data in a stream component */
ff_free_stream
(
s
,
s
->
streams
[
i
]);
st
=
s
->
streams
[
i
];
if
(
st
->
parser
)
{
av_parser_close
(
st
->
parser
);
}
if
(
st
->
attached_pic
.
data
)
av_free_packet
(
&
st
->
attached_pic
);
av_dict_free
(
&
st
->
metadata
);
av_freep
(
&
st
->
index_entries
);
av_freep
(
&
st
->
codec
->
extradata
);
av_freep
(
&
st
->
codec
->
subtitle_header
);
av_freep
(
&
st
->
codec
);
av_freep
(
&
st
->
priv_data
);
av_freep
(
&
st
->
info
);
av_freep
(
&
st
);
}
}
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
);
...
...
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