[FFmpeg-devel] [PATCH] Description of avcodec_encode_audio()

Michael Niedermayer michaelni
Thu Apr 2 14:01:41 CEST 2009


On Thu, Apr 02, 2009 at 11:33:43AM +0100, John Fletcher wrote:
> > patch rejected, the buffer MUST be FF_MIN_BUFFER_SIZE bytes large
> > and "is no longer applied" is incorrect it was never applied, the user
> > can if he either knows by some means that the buffer will be 
> > large enough
> > or works in a secure environment where the input is known not 
> > to contain
> > an exploit use a smaller buffer and deal with the segfaults somehow
> > The PCM case falls in the category where the user might know how much
> > space will be needed
> 
> OK, here is a revised patch.
> 
> I was misled by this comment so I think further explanation
> is helpful.
> 
> When encoding a video frame's worth of audio samples to PCM,
> you typically need to set buf_size to a value lower than
> FF_MIN_BUFFER_SIZE.
> 
> John

> Index: libavcodec/avcodec.h
> ===================================================================
> --- libavcodec/avcodec.h	(revision 18313)
> +++ libavcodec/avcodec.h	(working copy)
> @@ -3063,6 +3063,9 @@
>   * stored in output buffer \p buf.
>   *
>   * @note The output buffer should be at least \c FF_MIN_BUFFER_SIZE bytes large.
> + * However, for PCM audio the user will know how much space is needed
> + * because it depends on the passed in \p buf_size as described below.
> + * In that case a lower value can be used.
>   *

this is not equivalent to what i said

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090402/12ecd654/attachment.pgp>



More information about the ffmpeg-devel mailing list