[FFmpeg-cvslog] output example: free the muxing format context properly

Anton Khirnov git at videolan.org
Fri Jun 27 01:11:34 CEST 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Jun 24 11:10:57 2014 +0200| [a5864e9a253143437471dba61a533e7fa9acec1c] | committer: Anton Khirnov

output example: free the muxing format context properly

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5864e9a253143437471dba61a533e7fa9acec1c
---

 doc/examples/output.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/doc/examples/output.c b/doc/examples/output.c
index 7c29df1..0985659 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;
 }



More information about the ffmpeg-cvslog mailing list