[FFmpeg-cvslog] lavf: Document the codec context initialization

Vittorio Giovara git at videolan.org
Tue Feb 17 21:35:21 CET 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Thu Dec  4 19:09:40 2014 +0000| [bb7701684c7170dfd5f33a3c7d827265844619f2] | committer: Vittorio Giovara

lavf: Document the codec context initialization

During remuxing avcodec_copy_context() is discouraged as certain fields
(such as codec_tag) could reflect invalid values between input and
output contextes.

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

 libavformat/avformat.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 0994c80..aa11cff 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -198,6 +198,10 @@
  *   be set to the timebase that the caller desires to use for this stream (note
  *   that the timebase actually used by the muxer can be different, as will be
  *   described later).
+ * - It is advised to manually initialize only the relevant fields in
+ *   AVCodecContext, rather than using @ref avcodec_copy_context() during
+ *   remuxing: there is no guarantee that the codec context values remain valid
+ *   for both input and output format contexts.
  * - The caller may fill in additional information, such as @ref
  *   AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream"
  *   metadata, @ref AVFormatContext.chapters "chapters", @ref



More information about the ffmpeg-cvslog mailing list