comparison mov.c @ 1270:64be40fc28a5 libavformat

put dv demuxing code around ifdef
author bcoudurier
date Thu, 24 Aug 2006 08:37:51 +0000
parents f9ba65ef0dbf
children 8c80d41a11cc
comparison
equal deleted inserted replaced
1269:f9ba65ef0dbf 1270:64be40fc28a5
1728 sc->current_sample++; 1728 sc->current_sample++;
1729 if (sample->pos >= url_fsize(&s->pb)) { 1729 if (sample->pos >= url_fsize(&s->pb)) {
1730 av_log(mov->fc, AV_LOG_ERROR, "stream %d, offset 0x%llx: partial file\n", sc->ffindex, sample->pos); 1730 av_log(mov->fc, AV_LOG_ERROR, "stream %d, offset 0x%llx: partial file\n", sc->ffindex, sample->pos);
1731 return -1; 1731 return -1;
1732 } 1732 }
1733 1733 #ifdef CONFIG_DV_DEMUXER
1734 if (sc->dv_audio_container) { 1734 if (sc->dv_audio_container) {
1735 dv_get_packet(mov->dv_demux, pkt); 1735 dv_get_packet(mov->dv_demux, pkt);
1736 dprintf("dv audio pkt size %d\n", pkt->size); 1736 dprintf("dv audio pkt size %d\n", pkt->size);
1737 } else { 1737 } else {
1738 #endif
1738 url_fseek(&s->pb, sample->pos, SEEK_SET); 1739 url_fseek(&s->pb, sample->pos, SEEK_SET);
1739 av_get_packet(&s->pb, pkt, sample->size); 1740 av_get_packet(&s->pb, pkt, sample->size);
1741 #ifdef CONFIG_DV_DEMUXER
1740 if (mov->dv_demux) { 1742 if (mov->dv_demux) {
1741 void *pkt_destruct_func = pkt->destruct; 1743 void *pkt_destruct_func = pkt->destruct;
1742 dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size); 1744 dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size);
1743 pkt->destruct = pkt_destruct_func; 1745 pkt->destruct = pkt_destruct_func;
1744 } 1746 }
1745 } 1747 }
1748 #endif
1746 pkt->stream_index = sc->ffindex; 1749 pkt->stream_index = sc->ffindex;
1747 pkt->dts = sample->timestamp; 1750 pkt->dts = sample->timestamp;
1748 if (sc->ctts_data) { 1751 if (sc->ctts_data) {
1749 assert(sc->ctts_data[sc->sample_to_ctime_index].duration % sc->time_rate == 0); 1752 assert(sc->ctts_data[sc->sample_to_ctime_index].duration % sc->time_rate == 0);
1750 pkt->pts = pkt->dts + sc->ctts_data[sc->sample_to_ctime_index].duration / sc->time_rate; 1753 pkt->pts = pkt->dts + sc->ctts_data[sc->sample_to_ctime_index].duration / sc->time_rate;