[FFmpeg-devel] [PATCH] avio: make put_tag internal.

Ronald S. Bultje rsbultje
Wed Feb 23 16:21:43 CET 2011


Hi,

On Mon, Feb 21, 2011 at 4:18 PM, Anton Khirnov <anton at khirnov.net> wrote:
> ---
> ?libavformat/aiffenc.c ? ? ? | ? 11 +-
> ?libavformat/amr.c ? ? ? ? ? | ? ?5 +-
> ?libavformat/au.c ? ? ? ? ? ?| ? ?3 +-
> ?libavformat/avienc.c ? ? ? ?| ? 39 ++++----
> ?libavformat/avio.h ? ? ? ? ?| ? ?2 +-
> ?libavformat/avio_internal.h | ? ?5 +
> ?libavformat/aviobuf.c ? ? ? | ? ?6 +-
> ?libavformat/ffmetaenc.c ? ? | ? ?7 +-
> ?libavformat/flvenc.c ? ? ? ?| ? ?3 +-
> ?libavformat/gif.c ? ? ? ? ? | ? ?7 +-
> ?libavformat/gxfenc.c ? ? ? ?| ? ?7 +-
> ?libavformat/img2.c ? ? ? ? ?| ? ?9 +-
> ?libavformat/mmf.c ? ? ? ? ? | ? ?7 +-
> ?libavformat/movenc.c ? ? ? ?| ?215 ++++++++++++++++++++++---------------------
> ?libavformat/oggenc.c ? ? ? ?| ? ?3 +-
> ?libavformat/riff.c ? ? ? ? ?| ? ?3 +-
> ?libavformat/rmenc.c ? ? ? ? | ? 19 ++--
> ?libavformat/soxenc.c ? ? ? ?| ? ?5 +-
> ?libavformat/swfenc.c ? ? ? ?| ? ?5 +-
> ?libavformat/wav.c ? ? ? ? ? | ? ?5 +-
> ?20 files changed, 196 insertions(+), 170 deletions(-)

To summarize from IRC: I think put_tag() isn't a good function. It
mixes two things: writing fourccs and writing non-NULL terminated
strings.

For the second goal, we should have a third argument (can be an
internal-only function for now) to avio_put_str(), like
ffio_write_str(AVIOContext *ctx, const char *str, int
include_terminating_zero).

For the first goal, we should create a macro that calls avio_wl32(),
like #define ffio_write_fourcc(pb, str) ffio_wl32(pb,
MKTAG((str)[0],(str)[1],(str)[2],(str)[3])).

Ronald



More information about the ffmpeg-devel mailing list