changeset 1403:1973528c6975 libavformat

move memory reading ByteIOContext init from mov.c to avobuf.c
author michael
date Fri, 20 Oct 2006 09:32:48 +0000
parents 23541e51b7ca
children 53803884feb7
files aviobuf.c mov.c
diffstat 2 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/aviobuf.c	Thu Oct 19 10:05:36 2006 +0000
+++ b/aviobuf.c	Fri Oct 20 09:32:48 2006 +0000
@@ -54,6 +54,10 @@
     s->is_streamed = 0;
     s->max_packet_size = 0;
     s->update_checksum= NULL;
+    if(!read_packet && !write_flag){
+        s->pos = buffer_size;
+        s->buf_end = s->buffer + buffer_size;
+    }
     return 0;
 }
 
--- a/mov.c	Thu Oct 19 10:05:36 2006 +0000
+++ b/mov.c	Fri Oct 20 09:32:48 2006 +0000
@@ -1346,11 +1346,6 @@
 
 
 #ifdef CONFIG_ZLIB
-static int null_read_packet(void *opaque, uint8_t *buf, int buf_size)
-{
-    return buf_size;
-}
-
 static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
 {
     ByteIOContext ctx;
@@ -1383,7 +1378,7 @@
     get_buffer(pb, cmov_data, cmov_len);
     if(uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK)
         return -1;
-    if(init_put_byte(&ctx, moov_data, moov_len, 0, NULL, null_read_packet, NULL, NULL) != 0)
+    if(init_put_byte(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)
         return -1;
     atom.type = MKTAG( 'm', 'o', 'o', 'v' );
     atom.offset = 0;