On Wed, Oct 28, 2009 at 07:45:45PM -0400, Justin Ruggles wrote:
Michael Niedermayer wrote:
On Tue, Oct 27, 2009 at 05:54:51PM -0400, Justin Ruggles wrote:
Michael Niedermayer wrote:
+ new_samples_size = avctx->frame_size * avctx->channels * + (avctx->sample_fmt == SAMPLE_FMT_FLT ? + sizeof(float) : sizeof(int16_t)); + samples = av_mallocz(new_samples_size); + if (!samples) + return AVERROR(ENOMEM); + memcpy(samples, data, new_samples_size); i think the application is or at least should be required to allocate full
On Sun, Oct 25, 2009 at 09:04:45AM -0400, Justin Ruggles wrote: frames even for the possibly smaller last Where should this be documented? avcodec_encode_audio()?
yes and close to CODEC_CAP_SMALL_LAST_FRAME
Should the API require that the rest of the frame be padded with zeros? The encoder cannot modify the data, so if this is not required, the data would have to be copied in the encoder where there remaining samples could be zeroed out... thus making the allocation requirement useless.
its simpler (for applications and encoders) if the zero padding and actually also the allocation of a full frame is done in avcodec_encode_audio() [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In fact, the RIAA has been known to suggest that students drop out of college or go to community college in order to be able to afford settlements. -- The RIAA