Mercurial > libavformat.hg
comparison mov.c @ 3155:e22efe21156d libavformat
free track data asap
author | bcoudurier |
---|---|
date | Thu, 20 Mar 2008 16:00:45 +0000 |
parents | 01f6f3c905db |
children | 487b1979f195 |
comparison
equal
deleted
inserted
replaced
3154:01f6f3c905db | 3155:e22efe21156d |
---|---|
1269 #endif | 1269 #endif |
1270 case CODEC_ID_MP3ON4: | 1270 case CODEC_ID_MP3ON4: |
1271 st->codec->sample_rate= 0; /* let decoder init parameters properly */ | 1271 st->codec->sample_rate= 0; /* let decoder init parameters properly */ |
1272 break; | 1272 break; |
1273 } | 1273 } |
1274 | |
1275 /* Do not need those anymore. */ | |
1276 av_freep(&sc->chunk_offsets); | |
1277 av_freep(&sc->sample_to_chunk); | |
1278 av_freep(&sc->sample_sizes); | |
1279 av_freep(&sc->keyframes); | |
1280 av_freep(&sc->stts_data); | |
1281 | |
1274 return 0; | 1282 return 0; |
1275 } | 1283 } |
1276 | 1284 |
1277 static void mov_parse_udta_string(ByteIOContext *pb, char *str, int size) | 1285 static void mov_parse_udta_string(ByteIOContext *pb, char *str, int size) |
1278 { | 1286 { |
1543 | 1551 |
1544 static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) | 1552 static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) |
1545 { | 1553 { |
1546 MOVContext *mov = s->priv_data; | 1554 MOVContext *mov = s->priv_data; |
1547 ByteIOContext *pb = s->pb; | 1555 ByteIOContext *pb = s->pb; |
1548 int i, err; | 1556 int err; |
1549 MOV_atom_t atom = { 0, 0, 0 }; | 1557 MOV_atom_t atom = { 0, 0, 0 }; |
1550 | 1558 |
1551 mov->fc = s; | 1559 mov->fc = s; |
1552 | 1560 |
1553 if(!url_is_streamed(pb)) /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */ | 1561 if(!url_is_streamed(pb)) /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */ |
1562 err, mov->found_moov, mov->found_mdat, url_ftell(pb)); | 1570 err, mov->found_moov, mov->found_mdat, url_ftell(pb)); |
1563 return -1; | 1571 return -1; |
1564 } | 1572 } |
1565 dprintf(mov->fc, "on_parse_exit_offset=%d\n", (int) url_ftell(pb)); | 1573 dprintf(mov->fc, "on_parse_exit_offset=%d\n", (int) url_ftell(pb)); |
1566 | 1574 |
1567 for(i=0; i<s->nb_streams; i++) { | |
1568 MOVStreamContext *sc = s->streams[i]->priv_data; | |
1569 /* Do not need those anymore. */ | |
1570 av_freep(&sc->chunk_offsets); | |
1571 av_freep(&sc->sample_to_chunk); | |
1572 av_freep(&sc->sample_sizes); | |
1573 av_freep(&sc->keyframes); | |
1574 av_freep(&sc->stts_data); | |
1575 } | |
1576 return 0; | 1575 return 0; |
1577 } | 1576 } |
1578 | 1577 |
1579 static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) | 1578 static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) |
1580 { | 1579 { |