[Libav-user] About audio decoding

Lucas Soltic lucas.soltic at orange.fr
Sat Aug 10 16:11:59 CEST 2013


Hello,

Until now, I was using avcodec_audio_decode3(). But as I moved on to FFmpeg 2.0, I got issues with some decoders that indicated I should move on to avcodec_audio_decode4(). So that's what I am doing at the moment.

However, there is one part of the audio decode example that I do not understand:
if (avpkt.size < AUDIO_REFILL_THRESH) {
    /* Refill the input buffer, to avoid trying to decode
     * incomplete frames. Instead of this, one could also use
     * a parser, or use a proper container format through
     * libavformat. */
    memmove(inbuf, avpkt.data, avpkt.size);
    avpkt.data = inbuf;
    len = fread(avpkt.data + avpkt.size, 1,
                AUDIO_INBUF_SIZE - avpkt.size, f);
    if (len > 0)
        avpkt.size += len;
}

Does that mean that AVPacket can contain incomplete frames? I would have expected an AVPacket to contain one or several frames, but not incomplete ones…

I also do not understand what the 'parser' and 'proper container format' solutions would be.

Regards,
Lucas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130810/3d8642b5/attachment.html>


More information about the Libav-user mailing list