[FFmpeg-devel] [PATCH] avcodec_decode_audio3 and multiple frames in a packet

Sascha Sommer saschasommer
Fri Sep 11 12:13:02 CEST 2009


attached patch extends the documentation of avcodec_decode_audio3 a bit.
Previously, the case when multiple frames are stored in a single packet was 
not documented very well. I described the current behaviour of ffmpeg. That 
                avpkt.data += ret;
                avpkt.size -= ret;
is done until the packet is fully decoded.
This also makes it possible to return 0 until the last frame in a packet is 
decoded. This is currently done for wmapro.

What really changes the API is the change of the return value so maybe this 
should become avcodec_decode_audio4.
Previously a value of 0 meant that no frame was decoded.
I do not like this implication because

1. This can already be found out by checking *frame_size_ptr what should be 0
2. Consider a hypothetical audio codec that stores two 4-bit frames in a
    8-bit packet. The description of the function says that decoding stops
    after the first frame but what to return then?
    return 0 means that no frame has been decoded => wrong
    return 1 will abort the decoding after the first frame => wrong


-------------- next part --------------
A non-text attachment was scrubbed...
Name: avcodec_decode_audio3.patch
Type: text/x-diff
Size: 1548 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090911/6f6fc0c1/attachment.patch>

More information about the ffmpeg-devel mailing list