summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-02-04 12:04:16 +0200
committerRonald S. Bultje <rsbultje@gmail.com>2011-02-04 11:29:41 -0500
commitf124b087eea442b65d809582527dfb5092a3463c (patch)
tree6e6dcd28660d2d0c6d22ec41e97b8c372053b801 /libavformat/utils.c
parent1338dc082354b87c0e26f7f2ab09df5964b7f993 (diff)
libavformat: Add a function for freeing an AVFormatContext
This function is useful for freeing data structures allocated by muxers, which currently have to be freed manually by the caller. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 6a5c0f066d..d12bbc26c6 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2556,12 +2556,17 @@ int av_read_pause(AVFormatContext *s)
void av_close_input_stream(AVFormatContext *s)
{
- int i;
- AVStream *st;
-
flush_packet_queue(s);
if (s->iformat->read_close)
s->iformat->read_close(s);
+ avformat_free_context(s);
+}
+
+void avformat_free_context(AVFormatContext *s)
+{
+ int i;
+ AVStream *st;
+
for(i=0;i<s->nb_streams;i++) {
/* free all data in a stream component */
st = s->streams[i];