On Wed, 18 Sep 2013, Luca Barbato wrote:

On 18/09/13 21:07, Martin Storsjö wrote:
Null buffers are useful for simulating writing to a real buffer
for the sake of measuring how many bytes are written.
---
In practice this doesn't reduce the IO work completely, since
the data still is written to the intermediate IO buffer, but it
does avoid having to allocate the output buffer and copy data
into it, and simplifies the code a little for the callers.
---
 libavformat/avio_internal.h |   18 ++++++++++++++++++
 libavformat/aviobuf.c       |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)


Looks nice, maybe avio_flush on close is not necessary though.

It is necessary - otherwise the data will only be written in the normal AVIOContext buffer and not visible in d->size. (The fact that we already flush in avio_close is irrelevant, avio_close isn't called at all here, it's only paired with avio_open.)

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to