[FFmpeg-devel] [PATCH] move put_v from nutenc.c and make it public in avio.h and aviobuf.c
Måns Rullgård
mans
Thu Jul 1 01:05:22 CEST 2010
Michael Chinen <mchinen at gmail.com> writes:
> On Wed, Jun 30, 2010 at 1:09 PM, Michael Chinen <mchinen at gmail.com> wrote:
>> Hi,
>> I want to use put_v in utils.c, but it is a private function in
>> nutenc.c. ?Seems like it should be moved to avio.h and made public
>> with the other ByteIOContext put* funcs.
>> I recently committed this to soc but learned it should be put in the devel ML.
>
> modifying patch because updating svn has caused a conflict due to
> documentation fixes. Now against rev 23915.
>
> Index: libavformat/avio.h
> ===================================================================
> --- libavformat/avio.h (revision 23915)
> +++ libavformat/avio.h (working copy)
> @@ -348,8 +348,12 @@
> void put_tag(ByteIOContext *s, const char *tag);
>
> void put_strz(ByteIOContext *s, const char *buf);
> -
> +void put_v(ByteIOContext *bc, uint64_t val);
> /**
> + * Get the length in bytes which is needed to store val as v.
> + */
> +int get_length(uint64_t val);
> +/**
> * fseek() equivalent for ByteIOContext.
> * @return new position or AVERROR.
> */
> Index: libavformat/aviobuf.c
> ===================================================================
> --- libavformat/aviobuf.c (revision 23915)
> +++ libavformat/aviobuf.c (working copy)
> @@ -284,6 +284,27 @@
> put_byte(s, val);
> }
>
> +/**
> + * Get the length in bytes which is needed to store val as v.
> + */
You don't need to repeat the comment here. Once in the header is
enough.
> +int get_length(uint64_t val){
> + int i=1;
> +
> + while(val>>=7)
> + i++;
> +
> + return i;
> +}
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list