<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>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.</div><div><br></div><div>However, there is one part of the audio decode example that I do not understand:</div><div><div style="font-family: Menlo; font-size: 11px; margin: 0px; "><span style="color: rgb(194, 29, 70); ">if</span> (avpkt.size < AUDIO_REFILL_THRESH) {</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; color: rgb(0, 180, 0); "><span style="color: rgb(0, 0, 0); ">    </span>/* Refill the input buffer, to avoid trying to decode</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; color: rgb(0, 180, 0); ">     * incomplete frames. Instead of this, one could also use</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; color: rgb(0, 180, 0); ">     * a parser, or use a proper container format through</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; color: rgb(0, 180, 0); ">     * libavformat. */</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; ">    memmove(inbuf, avpkt.data, avpkt.size);</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; ">    avpkt.data = inbuf;</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; ">    len = fread(avpkt.data + avpkt.size, <span style="color: rgb(50, 51, 255); ">1</span>,</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; ">                AUDIO_INBUF_SIZE - avpkt.size, f);</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; ">    <span style="color: rgb(194, 29, 70); ">if</span> (len > <span style="color: rgb(50, 51, 255); ">0</span>)</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; ">        avpkt.size += len;</div><div style="font-family: Menlo; font-size: 11px; margin: 0px; ">}</div></div><div><br></div><div>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…</div><div><br></div><div>I also do not understand what the 'parser' and 'proper container format' solutions would be.</div><div><br></div><div>Regards,</div><div>Lucas</div></body></html>