OSDN Git Service

Merge commit 'cb70a93ca1e7fae1b5dfb65ad149d311a65206a4'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Feb 2015 20:25:07 +0000 (21:25 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Feb 2015 20:25:07 +0000 (21:25 +0100)
* commit 'cb70a93ca1e7fae1b5dfb65ad149d311a65206a4':
  lavc: Document interaction between avcodec_open2() and decoding routines

Conflicts:
libavcodec/avcodec.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/avcodec.h

@@@ -4185,17 -3705,12 +4194,20 @@@ int avcodec_decode_video2(AVCodecContex
   * and reusing a get_buffer written for video codecs would probably perform badly
   * due to a potentially very different allocation pattern.
   *
 + * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input
 + * and output. This means that for some packets they will not immediately
 + * produce decoded output and need to be flushed at the end of decoding to get
 + * all the decoded data. Flushing is done by calling this function with packets
 + * with avpkt->data set to NULL and avpkt->size set to 0 until it stops
 + * returning subtitles. It is safe to flush even those decoders that are not
 + * marked with CODEC_CAP_DELAY, then no subtitles will be returned.
 + *
+  * @note The AVCodecContext MUST have been opened with @ref avcodec_open2()
+  * before packets may be fed to the decoder.
+  *
   * @param avctx the codec context
 - * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
 -                   freed with avsubtitle_free if *got_sub_ptr is set.
 + * @param[out] sub The Preallocated AVSubtitle in which the decoded subtitle will be stored,
 + *                 must be freed with avsubtitle_free if *got_sub_ptr is set.
   * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
   * @param[in] avpkt The input AVPacket containing the input buffer.
   */