Commit fb74658d authored by michael's avatar michael

move memory reading ByteIOContext init from mov.c to avobuf.c


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6744 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 74911f75
...@@ -54,6 +54,10 @@ int init_put_byte(ByteIOContext *s, ...@@ -54,6 +54,10 @@ int init_put_byte(ByteIOContext *s,
s->is_streamed = 0; s->is_streamed = 0;
s->max_packet_size = 0; s->max_packet_size = 0;
s->update_checksum= NULL; s->update_checksum= NULL;
if(!read_packet && !write_flag){
s->pos = buffer_size;
s->buf_end = s->buffer + buffer_size;
}
return 0; return 0;
} }
......
...@@ -1346,11 +1346,6 @@ static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -1346,11 +1346,6 @@ static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
#ifdef CONFIG_ZLIB #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) static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{ {
ByteIOContext ctx; ByteIOContext ctx;
...@@ -1383,7 +1378,7 @@ static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -1383,7 +1378,7 @@ static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
get_buffer(pb, cmov_data, cmov_len); get_buffer(pb, cmov_data, cmov_len);
if(uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK) if(uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK)
return -1; 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; return -1;
atom.type = MKTAG( 'm', 'o', 'o', 'v' ); atom.type = MKTAG( 'm', 'o', 'o', 'v' );
atom.offset = 0; atom.offset = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment