[FFmpeg-devel] [PATCH 3/3] avcodec/internal: Document how to avoid the internal->byte_buffer with ff_alloc_packet2()

Hendrik Leppkes h.leppkes at gmail.com
Mon Jul 6 12:13:41 CEST 2015


On Mon, Jul 6, 2015 at 12:07 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavcodec/internal.h |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavcodec/internal.h b/libavcodec/internal.h
> index 2feb68b..c410f8b 100644
> --- a/libavcodec/internal.h
> +++ b/libavcodec/internal.h
> @@ -210,6 +210,9 @@ int avpriv_unlock_avformat(void);
>   * or allocated in this function.
>   *
>   * @param avctx   the AVCodecContext of the encoder
> + *                this can be set to NULL to avoid the use of internal->byte_buffer
> + *                in the allocation algorithm. When the final used size is well
> + *                known it is more efficient to not use internal->byte_buffer.
>   * @param avpkt   the AVPacket
>   *                If avpkt->data is already set, avpkt->size is checked
>   *                to ensure it is large enough.

This seems terrible. Can't it somehow be made smarter?
Passing a NULL context is hardly intuitive or obvious.

- Hendrik


More information about the ffmpeg-devel mailing list