[FFmpeg-devel] [PATCH] avio: add avio_get_str as a replacement for get_strz

Ronald S. Bultje rsbultje
Mon Feb 21 12:53:26 CET 2011


Hi,

On Mon, Feb 21, 2011 at 2:13 AM, Anton Khirnov <anton at khirnov.net> wrote:
> It's more flexible and compatible with avio_get_str16.
> ---
> ?libavformat/avio.h ? ?| ? 16 +++++++++++++++-
> ?libavformat/aviobuf.c | ? 29 +++++++++++++++++++----------
> ?libavformat/cafdec.c ?| ? ?4 ++--
> ?libavformat/ffmdec.c ?| ? ?3 ++-
> ?libavformat/mov.c ? ? | ? ?2 +-
> ?5 files changed, 39 insertions(+), 15 deletions(-)
>
> diff --git a/libavformat/avio.h b/libavformat/avio.h
> index 060f06e..7684769 100644
> --- a/libavformat/avio.h
> +++ b/libavformat/avio.h
> @@ -487,6 +487,14 @@ uint64_t get_le64(AVIOContext *s);
> ?unsigned int get_le16(AVIOContext *s);
>
> ?/**
> + * Read a UTF-8 string from pb. The reading will terminate when either
> + * a NULL character was encountered or maxlen bytes have been read.
> + *
> + * @return number of bytes read (is always <= maxlen).
> + */
> +int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);

How does this API fit with the "new" avio_read/write,
avio_[rw]{8,[lb]{16,24,32}}? Shouldn't get_string become something
read also?

Ronald



More information about the ffmpeg-devel mailing list