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

Anton Khirnov anton
Thu Feb 24 08:02:00 CET 2011


On Mon, Feb 21, 2011 at 06:53:26AM -0500, Ronald S. Bultje wrote:
> 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?

I'd say it's more important to be consistent with the other avio_*_str
fnctions, so unless we want to rename them too, I'd leave this name.

-- 
Anton Khirnov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110224/ac8b8fa3/attachment.pgp>



More information about the ffmpeg-devel mailing list