comparison mov.c @ 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
comparison
equal deleted inserted replaced
1402:23541e51b7ca 1403:1973528c6975
1344 return err; 1344 return err;
1345 } 1345 }
1346 1346
1347 1347
1348 #ifdef CONFIG_ZLIB 1348 #ifdef CONFIG_ZLIB
1349 static int null_read_packet(void *opaque, uint8_t *buf, int buf_size)
1350 {
1351 return buf_size;
1352 }
1353
1354 static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) 1349 static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
1355 { 1350 {
1356 ByteIOContext ctx; 1351 ByteIOContext ctx;
1357 uint8_t *cmov_data; 1352 uint8_t *cmov_data;
1358 uint8_t *moov_data; /* uncompressed data */ 1353 uint8_t *moov_data; /* uncompressed data */
1381 return -1; 1376 return -1;
1382 } 1377 }
1383 get_buffer(pb, cmov_data, cmov_len); 1378 get_buffer(pb, cmov_data, cmov_len);
1384 if(uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK) 1379 if(uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK)
1385 return -1; 1380 return -1;
1386 if(init_put_byte(&ctx, moov_data, moov_len, 0, NULL, null_read_packet, NULL, NULL) != 0) 1381 if(init_put_byte(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)
1387 return -1; 1382 return -1;
1388 atom.type = MKTAG( 'm', 'o', 'o', 'v' ); 1383 atom.type = MKTAG( 'm', 'o', 'o', 'v' );
1389 atom.offset = 0; 1384 atom.offset = 0;
1390 atom.size = moov_len; 1385 atom.size = moov_len;
1391 #ifdef DEBUG 1386 #ifdef DEBUG