diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-06-18 11:35:44 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-09-24 17:34:00 +0200 |
commit | 5f4b1b1cbd0604b74cacc0870b501659240b5b45 (patch) | |
tree | 12b38e09cc56e99c6afc293a5bb6e7205ebc5507 /libavcodec | |
parent | 2725f2d40315b56f17c5dffe39dda7d94786302d (diff) | |
download | ffmpeg-5f4b1b1cbd0604b74cacc0870b501659240b5b45.tar.gz |
lavc doxy: document that avcodec_flush_buffers() invalidates decoded frames
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index b894ee8ecc..60cbeece57 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3388,8 +3388,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, * to the frame if av_frame_is_writable() returns 1. * When AVCodecContext.refcounted_frames is set to 0, the returned * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. - * The caller may not write to it. + * next call to this function or until closing or flushing the + * decoder. The caller may not write to it. * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is * non-zero. * @param[in] avpkt The input AVPacket containing the input buffer. @@ -3437,8 +3437,8 @@ int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, * to the frame if av_frame_is_writable() returns 1. * When AVCodecContext.refcounted_frames is set to 0, the returned * reference belongs to the decoder and is valid only until the - * next call to this function or until closing the decoder. The - * caller may not write to it. + * next call to this function or until closing or flushing the + * decoder. The caller may not write to it. * * @param[in] avpkt The input AVpacket containing the input buffer. * You can create such packet with av_init_packet() and by then setting @@ -4060,7 +4060,13 @@ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, int buf_size, int align); /** - * Flush buffers, should be called when seeking or when switching to a different stream. + * Reset the internal decoder state / flush internal buffers. Should be called + * e.g. when seeking or when switching to a different stream. + * + * @note when refcounted frames are not used (i.e. avctx->refcounted_frames is 0), + * this invalidates the frames previously returned from the decoder. When + * refcounted frames are used, the decoder just releases any references it might + * keep internally, but the caller's reference remains valid. */ void avcodec_flush_buffers(AVCodecContext *avctx); |