OSDN Git Service

lavf: Document the codec context initialization
authorVittorio Giovara <vittorio.giovara@gmail.com>
Thu, 4 Dec 2014 19:09:40 +0000 (19:09 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 17 Feb 2015 16:27:42 +0000 (11:27 -0500)
During remuxing avcodec_copy_context() is discouraged as certain fields
(such as codec_tag) could reflect invalid values between input and
output contextes.

libavformat/avformat.h

index 0994c80..aa11cff 100644 (file)
  *   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