avcodec_decode_audio3

Wrapper function which calls avcodec_decode_audio4.

@deprecated Use avcodec_decode_audio4 instead.

Decode the audio frame of size avpkt->size from avpkt->data into samples. Some decoders may support multiple frames in a single AVPacket, such decoders would then just decode the first frame. In this case, avcodec_decode_audio3 has to be called again with an AVPacket that contains the remaining data in order to decode the second frame etc. If no frame could be outputted, frame_size_ptr is zero. Otherwise, it is the decompressed frame size in bytes.

@warning You must set frame_size_ptr to the allocated size of the output buffer before calling avcodec_decode_audio3().

@warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.

@warning The end of the input buffer avpkt->data should be set to 0 to ensure that no overreading happens for damaged MPEG streams.

@warning You must not provide a custom get_buffer() when using avcodec_decode_audio3(). Doing so will override it with avcodec_default_get_buffer. Use avcodec_decode_audio4() instead, which does allow the application to provide a custom get_buffer().

@note You might have to align the input buffer avpkt->data and output buffer samples. The alignment requirements depend on the CPU: On some CPUs it isn't necessary at all, on others it won't work at all if not aligned and on others it will work but it will have an impact on performance.

In practice, avpkt->data should have 4 byte alignment at minimum and samples should be 16 byte aligned unless the CPU doesn't need it (AltiVec and SSE do).

@note Codecs which have the CODEC_CAP_DELAY capability set have a delay between input and output, these need to be fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames.

@param avctx the codec context @paramout samples the output buffer, sample type in avctx->sample_fmt If the sample format is planar, each channel plane will be the same size, with no padding between channels. @param[in,out] frame_size_ptr the output buffer size in bytes @paramin avpkt The input AVPacket containing the input buffer. You can create such packet with av_init_packet() and by then setting data and size, some decoders might in addition need other fields. All decoders are designed to use the least fields possible though. @return On error a negative value is returned, otherwise the number of bytes used or zero if no frame data was decompressed (used) from the input AVPacket.

@nogc nothrow extern (C) deprecated
static if(FF_API_OLD_DECODE_AUDIO)
int
avcodec_decode_audio3

Meta