comparison mov.c @ 3029:10abe8748ec2 libavformat

use correct demux mechanism when audio compression id is -2, dv audio does not matter, demux partially qt_dv_pal_test.mov which does NOT use cid -2
author bcoudurier
date Mon, 11 Feb 2008 22:23:05 +0000
parents 8ba21013bcbf
children 5064dffc46b7
comparison
equal deleted inserted replaced
3028:8ab0d506d8ff 3029:10abe8748ec2
106 int current_sample; 106 int current_sample;
107 unsigned int bytes_per_frame; 107 unsigned int bytes_per_frame;
108 unsigned int samples_per_frame; 108 unsigned int samples_per_frame;
109 int dv_audio_container; 109 int dv_audio_container;
110 int pseudo_stream_id; 110 int pseudo_stream_id;
111 int16_t audio_cid; ///< stsd audio compression id
111 } MOVStreamContext; 112 } MOVStreamContext;
112 113
113 typedef struct MOVContext { 114 typedef struct MOVContext {
114 AVFormatContext *fc; 115 AVFormatContext *fc;
115 int time_scale; 116 int time_scale;
741 dprintf(c->fc, "audio channels %d\n", st->codec->channels); 742 dprintf(c->fc, "audio channels %d\n", st->codec->channels);
742 st->codec->bits_per_sample = get_be16(pb); /* sample size */ 743 st->codec->bits_per_sample = get_be16(pb); /* sample size */
743 /* do we need to force to 16 for AMR ? */ 744 /* do we need to force to 16 for AMR ? */
744 745
745 /* handle specific s8 codec */ 746 /* handle specific s8 codec */
746 get_be16(pb); /* compression id = 0*/ 747 sc->audio_cid = get_be16(pb);
747 get_be16(pb); /* packet size = 0 */ 748 get_be16(pb); /* packet size = 0 */
748 749
749 st->codec->sample_rate = ((get_be32(pb) >> 16)); 750 st->codec->sample_rate = ((get_be32(pb) >> 16));
750 751
751 switch (st->codec->codec_id) { 752 switch (st->codec->codec_id) {
1327 unsigned int stts_index = 0; 1328 unsigned int stts_index = 0;
1328 unsigned int stsc_index = 0; 1329 unsigned int stsc_index = 0;
1329 unsigned int stss_index = 0; 1330 unsigned int stss_index = 0;
1330 unsigned int i, j, k; 1331 unsigned int i, j, k;
1331 1332
1332 if (sc->sample_sizes || st->codec->codec_type == CODEC_TYPE_VIDEO || sc->dv_audio_container) { 1333 if (sc->sample_sizes || st->codec->codec_type == CODEC_TYPE_VIDEO ||
1334 sc->audio_cid == -2) {
1333 unsigned int current_sample = 0; 1335 unsigned int current_sample = 0;
1334 unsigned int stts_sample = 0; 1336 unsigned int stts_sample = 0;
1335 unsigned int keyframe, sample_size; 1337 unsigned int keyframe, sample_size;
1336 unsigned int distance = 0; 1338 unsigned int distance = 0;
1337 1339