Mercurial > libavformat.hg
comparison mov.c @ 4206:c3102b189cb6 libavformat
Change semantic of CONFIG_*, HAVE_* and ARCH_*.
They are now always defined to either 0 or 1.
author | aurel |
---|---|
date | Tue, 13 Jan 2009 23:44:16 +0000 |
parents | baf5439883f1 |
children | 44f4dca12784 |
comparison
equal
deleted
inserted
replaced
4205:41878938d030 | 4206:c3102b189cb6 |
---|---|
29 #include "isom.h" | 29 #include "isom.h" |
30 #include "dv.h" | 30 #include "dv.h" |
31 #include "libavcodec/mpeg4audio.h" | 31 #include "libavcodec/mpeg4audio.h" |
32 #include "libavcodec/mpegaudiodata.h" | 32 #include "libavcodec/mpegaudiodata.h" |
33 | 33 |
34 #ifdef CONFIG_ZLIB | 34 #if CONFIG_ZLIB |
35 #include <zlib.h> | 35 #include <zlib.h> |
36 #endif | 36 #endif |
37 | 37 |
38 /* | 38 /* |
39 * First version by Francois Revol revol@free.fr | 39 * First version by Francois Revol revol@free.fr |
1003 if(st->codec->codec_type==CODEC_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) | 1003 if(st->codec->codec_type==CODEC_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) |
1004 st->codec->sample_rate= sc->time_scale; | 1004 st->codec->sample_rate= sc->time_scale; |
1005 | 1005 |
1006 /* special codec parameters handling */ | 1006 /* special codec parameters handling */ |
1007 switch (st->codec->codec_id) { | 1007 switch (st->codec->codec_id) { |
1008 #ifdef CONFIG_DV_DEMUXER | 1008 #if CONFIG_DV_DEMUXER |
1009 case CODEC_ID_DVAUDIO: | 1009 case CODEC_ID_DVAUDIO: |
1010 c->dv_fctx = av_alloc_format_context(); | 1010 c->dv_fctx = av_alloc_format_context(); |
1011 c->dv_demux = dv_init_demux(c->dv_fctx); | 1011 c->dv_demux = dv_init_demux(c->dv_fctx); |
1012 if (!c->dv_demux) { | 1012 if (!c->dv_demux) { |
1013 av_log(c->fc, AV_LOG_ERROR, "dv demux context init error\n"); | 1013 av_log(c->fc, AV_LOG_ERROR, "dv demux context init error\n"); |
1378 st->index, sc->drefs[sc->dref_id-1].path, strerror(errno)); | 1378 st->index, sc->drefs[sc->dref_id-1].path, strerror(errno)); |
1379 } else | 1379 } else |
1380 sc->pb = c->fc->pb; | 1380 sc->pb = c->fc->pb; |
1381 | 1381 |
1382 switch (st->codec->codec_id) { | 1382 switch (st->codec->codec_id) { |
1383 #ifdef CONFIG_H261_DECODER | 1383 #if CONFIG_H261_DECODER |
1384 case CODEC_ID_H261: | 1384 case CODEC_ID_H261: |
1385 #endif | 1385 #endif |
1386 #ifdef CONFIG_H263_DECODER | 1386 #if CONFIG_H263_DECODER |
1387 case CODEC_ID_H263: | 1387 case CODEC_ID_H263: |
1388 #endif | 1388 #endif |
1389 #ifdef CONFIG_MPEG4_DECODER | 1389 #if CONFIG_MPEG4_DECODER |
1390 case CODEC_ID_MPEG4: | 1390 case CODEC_ID_MPEG4: |
1391 #endif | 1391 #endif |
1392 st->codec->width= 0; /* let decoder init width/height */ | 1392 st->codec->width= 0; /* let decoder init width/height */ |
1393 st->codec->height= 0; | 1393 st->codec->height= 0; |
1394 break; | 1394 break; |
1689 return err; | 1689 return err; |
1690 } | 1690 } |
1691 | 1691 |
1692 static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOVAtom atom) | 1692 static int mov_read_cmov(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
1693 { | 1693 { |
1694 #ifdef CONFIG_ZLIB | 1694 #if CONFIG_ZLIB |
1695 ByteIOContext ctx; | 1695 ByteIOContext ctx; |
1696 uint8_t *cmov_data; | 1696 uint8_t *cmov_data; |
1697 uint8_t *moov_data; /* uncompressed data */ | 1697 uint8_t *moov_data; /* uncompressed data */ |
1698 long cmov_len, moov_len; | 1698 long cmov_len, moov_len; |
1699 int ret = -1; | 1699 int ret = -1; |
1937 av_log(mov->fc, AV_LOG_ERROR, "stream %d, offset 0x%"PRIx64": partial file\n", | 1937 av_log(mov->fc, AV_LOG_ERROR, "stream %d, offset 0x%"PRIx64": partial file\n", |
1938 sc->ffindex, sample->pos); | 1938 sc->ffindex, sample->pos); |
1939 return -1; | 1939 return -1; |
1940 } | 1940 } |
1941 av_get_packet(sc->pb, pkt, sample->size); | 1941 av_get_packet(sc->pb, pkt, sample->size); |
1942 #ifdef CONFIG_DV_DEMUXER | 1942 #if CONFIG_DV_DEMUXER |
1943 if (mov->dv_demux && sc->dv_audio_container) { | 1943 if (mov->dv_demux && sc->dv_audio_container) { |
1944 dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size); | 1944 dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size); |
1945 av_free(pkt->data); | 1945 av_free(pkt->data); |
1946 pkt->size = 0; | 1946 pkt->size = 0; |
1947 if (dv_get_packet(mov->dv_demux, pkt) < 0) | 1947 if (dv_get_packet(mov->dv_demux, pkt) < 0) |