[FFmpeg-devel] [PATCH] Description of avcodec_encode_audio()
Michael Niedermayer
michaelni
Thu Apr 2 22:32:10 CEST 2009
On Thu, Apr 02, 2009 at 09:15:29PM +0100, John Fletcher wrote:
> > "pcm" there is nothing pcm specific
> >
>
> It is different for PCM because in that case buf_size
> determines the number of samples to be encoded, as explained
> in the current description of the function:
>
> * @param[in] samples the input buffer containing the samples
> * The number of samples read from this buffer is frame_size*channels,
> * both of which are defined in \p avctx.
> * For PCM audio the number of samples read from \p samples is equal to
> * \p buf_size * input_sample_size / output_sample_size.
>
> This is the whole problem. You can't set buffer to be FF_MIN_BUFFER_SIZE
> in case of PCM, or more strictly, you can't set buf_size to be that value.
> This is why I asked about actual size vs. buf_size.
if you provide less than FF_MIN_BUFFER_SIZE and the code ends up needing
more than behavior is undefined (that is your computer can join the closest
botnet)
if you provide more or equal than FF_MIN_BUFFER_SIZE and the code ends up
needing more than you get a clear failure
you can never just use FF_MIN_BUFFER_SIZE, as this will in general be too
small.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- 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/0cd84aa2/attachment.pgp>
More information about the ffmpeg-devel
mailing list