comparison mov.c @ 1404:53803884feb7 libavformat

warn about zlib support needed if file has compressed moov atom
author bcoudurier
date Fri, 20 Oct 2006 13:06:50 +0000
parents 1973528c6975
children b22de1465a33
comparison
equal deleted inserted replaced
1403:1973528c6975 1404:53803884feb7
1342 } 1342 }
1343 err = mov_read_mdat(c, pb, atom); 1343 err = mov_read_mdat(c, pb, atom);
1344 return err; 1344 return err;
1345 } 1345 }
1346 1346
1347 1347 static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
1348 {
1348 #ifdef CONFIG_ZLIB 1349 #ifdef CONFIG_ZLIB
1349 static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
1350 {
1351 ByteIOContext ctx; 1350 ByteIOContext ctx;
1352 uint8_t *cmov_data; 1351 uint8_t *cmov_data;
1353 uint8_t *moov_data; /* uncompressed data */ 1352 uint8_t *moov_data; /* uncompressed data */
1354 long cmov_len, moov_len; 1353 long cmov_len, moov_len;
1355 int ret; 1354 int ret;
1387 // { int fd = open("/tmp/uncompheader.mov", O_WRONLY | O_CREAT); write(fd, moov_data, moov_len); close(fd); } 1386 // { int fd = open("/tmp/uncompheader.mov", O_WRONLY | O_CREAT); write(fd, moov_data, moov_len); close(fd); }
1388 #endif 1387 #endif
1389 ret = mov_read_default(c, &ctx, atom); 1388 ret = mov_read_default(c, &ctx, atom);
1390 av_free(moov_data); 1389 av_free(moov_data);
1391 av_free(cmov_data); 1390 av_free(cmov_data);
1392
1393 return ret; 1391 return ret;
1394 } 1392 #else
1395 #endif 1393 av_log(c->fc, AV_LOG_ERROR, "this file requires zlib support compiled in\n");
1394 return -1;
1395 #endif
1396 }
1396 1397
1397 /* edit list atom */ 1398 /* edit list atom */
1398 static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) 1399 static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
1399 { 1400 {
1400 int i, edit_count; 1401 int i, edit_count;
1485 { MKTAG( 's', 's', 'r', 'c' ), mov_read_leaf }, 1486 { MKTAG( 's', 's', 'r', 'c' ), mov_read_leaf },
1486 { MKTAG( 's', 'y', 'n', 'c' ), mov_read_leaf }, 1487 { MKTAG( 's', 'y', 'n', 'c' ), mov_read_leaf },
1487 { MKTAG( 't', 'c', 'm', 'd' ), mov_read_leaf }, 1488 { MKTAG( 't', 'c', 'm', 'd' ), mov_read_leaf },
1488 { MKTAG( 'w', 'i', 'd', 'e' ), mov_read_wide }, /* place holder */ 1489 { MKTAG( 'w', 'i', 'd', 'e' ), mov_read_wide }, /* place holder */
1489 //{ MKTAG( 'r', 'm', 'q', 'u' ), mov_read_leaf }, 1490 //{ MKTAG( 'r', 'm', 'q', 'u' ), mov_read_leaf },
1490 #ifdef CONFIG_ZLIB
1491 { MKTAG( 'c', 'm', 'o', 'v' ), mov_read_cmov }, 1491 { MKTAG( 'c', 'm', 'o', 'v' ), mov_read_cmov },
1492 #else
1493 { MKTAG( 'c', 'm', 'o', 'v' ), mov_read_leaf },
1494 #endif
1495 { 0L, mov_read_leaf } 1492 { 0L, mov_read_leaf }
1496 }; 1493 };
1497 1494
1498 static void mov_free_stream_context(MOVStreamContext *sc) 1495 static void mov_free_stream_context(MOVStreamContext *sc)
1499 { 1496 {