/**
* Allocate an AVFormatContext.
- * Can be freed with av_free() but do not forget to free everything you
- * explicitly allocated as well!
+ * avformat_free_context() can be used to free the context and everything
+ * allocated by the framework within it.
*/
AVFormatContext *avformat_alloc_context(void);
void av_close_input_file(AVFormatContext *s);
/**
+ * Free an AVFormatContext and all its streams.
+ * @param s context to free
+ */
+void avformat_free_context(AVFormatContext *s);
+
+/**
* Add a new stream to a media file.
*
* Can only be called in the read_header() function. If the flag