Mercurial > libavcodec.hg
comparison avcodec.h @ 10389:c857cd6b77b6 libavcodec
extend description of avcodec_decode_audio3:
- clarify when 0 is returned
- explain that decode_audio3 has to be called multiple times when there
are multiple frames in a single packet
| author | faust3 |
|---|---|
| date | Mon, 12 Oct 2009 19:50:31 +0000 |
| parents | 98501365c3aa |
| children | 81cf22a16ab3 |
comparison
equal
deleted
inserted
replaced
| 10388:08e50bcdcbf1 | 10389:c857cd6b77b6 |
|---|---|
| 3226 #endif | 3226 #endif |
| 3227 | 3227 |
| 3228 /** | 3228 /** |
| 3229 * Decodes the audio frame of size avpkt->size from avpkt->data into samples. | 3229 * Decodes the audio frame of size avpkt->size from avpkt->data into samples. |
| 3230 * Some decoders may support multiple frames in a single AVPacket, such | 3230 * Some decoders may support multiple frames in a single AVPacket, such |
| 3231 * decoders would then just decode the first frame. | 3231 * decoders would then just decode the first frame. In this case, |
| 3232 * avcodec_decode_audio3 has to be called again with an AVPacket that contains | |
| 3233 * the remaining data in order to decode the second frame etc. | |
| 3232 * If no frame | 3234 * If no frame |
| 3233 * could be decompressed, frame_size_ptr is zero. Otherwise, it is the | 3235 * could be outputted, frame_size_ptr is zero. Otherwise, it is the |
| 3234 * decompressed frame size in bytes. | 3236 * decompressed frame size in bytes. |
| 3235 * | 3237 * |
| 3236 * @warning You must set frame_size_ptr to the allocated size of the | 3238 * @warning You must set frame_size_ptr to the allocated size of the |
| 3237 * output buffer before calling avcodec_decode_audio3(). | 3239 * output buffer before calling avcodec_decode_audio3(). |
| 3238 * | 3240 * |
| 3258 * @param[in] avpkt The input AVPacket containing the input buffer. | 3260 * @param[in] avpkt The input AVPacket containing the input buffer. |
| 3259 * You can create such packet with av_init_packet() and by then setting | 3261 * You can create such packet with av_init_packet() and by then setting |
| 3260 * data and size, some decoders might in addition need other fields. | 3262 * data and size, some decoders might in addition need other fields. |
| 3261 * All decoders are designed to use the least fields possible though. | 3263 * All decoders are designed to use the least fields possible though. |
| 3262 * @return On error a negative value is returned, otherwise the number of bytes | 3264 * @return On error a negative value is returned, otherwise the number of bytes |
| 3263 * used or zero if no frame could be decompressed. | 3265 * used or zero if no frame data was decompressed (used) from the input AVPacket. |
| 3264 */ | 3266 */ |
| 3265 int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, | 3267 int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, |
| 3266 int *frame_size_ptr, | 3268 int *frame_size_ptr, |
| 3267 AVPacket *avpkt); | 3269 AVPacket *avpkt); |
| 3268 | 3270 |
