[FFmpeg-devel] [PATCH 1/3] utils.c: when packets are written by s->oformat->write_packet( ), add output packet size to out_bytes.

Michael Smithng michael at transparentpixel.com
Tue Aug 14 23:30:02 CEST 2012

On Aug 13, 2012, at 8:29 PM, Michael Niedermayer wrote:

> this looks wrong
> you are changing public API and add a unused return value.

The return values (considering the changes to ffmpeg.c) are being used. This is how we're getting the actual number of bytes written to the ost rather than just bytes decoded.

The return value is still consistent with the way it's being used elsewhere in the code. Previously the return value was either 0 for success or negative for an error. It's still positive for success but now can have a non-zero value. Since the value was checked for negative or positive, this will not affect its use.

> The packet size is in AVPacket.size the question is why is it not
> added up correctly, or why/where the value gets messed up before being
> added up
> [...]

We tried using AVPacket.size but the return values were less than useful for the purpose.

More information about the ffmpeg-devel mailing list