[FFmpeg-devel] [PATCH] move put_v from nutenc.c and make it public in avio.h and aviobuf.c
Michael Chinen
mchinen
Thu Jul 1 01:37:53 CEST 2010
2010/7/1 M?ns Rullg?rd <mans at mansr.com>:
>> +/**
>> + * 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.
ok. done.
Index: libavformat/avio.h
===================================================================
--- libavformat/avio.h (revision 23915)
+++ libavformat/avio.h (working copy)
@@ -348,8 +348,14 @@
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,24 @@
put_byte(s, val);
}
+int get_length(uint64_t val){
+ int i=1;
+
+ while(val>>=7)
+ i++;
+
+ return i;
+}
+
+void put_v(ByteIOContext *bc, uint64_t val){
+ int i= get_length(val);
+
+ while(--i>0)
+ put_byte(bc, 128 | (val>>(7*i)));
+
+ put_byte(bc, val&127);
+}
+
void put_tag(ByteIOContext *s, const char *tag)
{
while (*tag) {
Index: libavformat/nutenc.c
===================================================================
--- libavformat/nutenc.c (revision 23915)
+++ libavformat/nutenc.c (working copy)
@@ -241,27 +241,6 @@
nut->frame_code['N'].flags= FLAG_INVALID;
}
-/**
- * Get the length in bytes which is needed to store val as v.
- */
-static int get_length(uint64_t val){
- int i=1;
-
- while(val>>=7)
- i++;
-
- return i;
-}
-
-static void put_v(ByteIOContext *bc, uint64_t val){
- int i= get_length(val);
-
- while(--i>0)
- put_byte(bc, 128 | (val>>(7*i)));
-
- put_byte(bc, val&127);
-}
-
static void put_tt(NUTContext *nut, StreamContext *nus, ByteIOContext
*bc, uint64_t val){
val *= nut->time_base_count;
val += nus->time_base - nut->time_base;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: moving_put_v_r23915_2.patch
Type: application/octet-stream
Size: 1900 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100701/2e1afd97/attachment.obj>
More information about the ffmpeg-devel
mailing list