diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-06-24 13:10:57 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-06-26 18:08:06 +0400 |
commit | a5864e9a253143437471dba61a533e7fa9acec1c (patch) | |
tree | 70701bdcad6feb7445ac16f26edde7509900b485 | |
parent | 182d3f8221c23716ea4eafa460bdb94968f71f26 (diff) |
output example: free the muxing format context properly
-rw-r--r-- | doc/examples/output.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/doc/examples/output.c b/doc/examples/output.c index 7c29df1fdf..0985659509 100644 --- a/doc/examples/output.c +++ b/doc/examples/output.c @@ -549,18 +549,12 @@ int main(int argc, char **argv) if (have_audio) close_stream(oc, &audio_st); - /* Free the streams. */ - for (i = 0; i < oc->nb_streams; i++) { - av_freep(&oc->streams[i]->codec); - av_freep(&oc->streams[i]); - } - if (!(fmt->flags & AVFMT_NOFILE)) /* Close the output file. */ avio_close(oc->pb); /* free the stream */ - av_free(oc); + avformat_free_context(oc); return 0; } |