comparison smacker.c @ 5607:9143e8efec99 libavformat

Demux Bink audio in Smacker files
author daniel
date Sat, 30 Jan 2010 10:31:10 +0000
parents 942ca859a587
children cdc913460d61
comparison
equal deleted inserted replaced
5606:2023dcca33ff 5607:9143e8efec99
170 av_reduce(&tbase, &smk->pts_inc, tbase, smk->pts_inc, (1UL<<31)-1); 170 av_reduce(&tbase, &smk->pts_inc, tbase, smk->pts_inc, (1UL<<31)-1);
171 av_set_pts_info(st, 33, smk->pts_inc, tbase); 171 av_set_pts_info(st, 33, smk->pts_inc, tbase);
172 /* handle possible audio streams */ 172 /* handle possible audio streams */
173 for(i = 0; i < 7; i++) { 173 for(i = 0; i < 7; i++) {
174 smk->indexes[i] = -1; 174 smk->indexes[i] = -1;
175 if((smk->rates[i] & 0xFFFFFF) && !(smk->rates[i] & SMK_AUD_BINKAUD)){ 175 if(smk->rates[i] & 0xFFFFFF){
176 ast[i] = av_new_stream(s, 0); 176 ast[i] = av_new_stream(s, 0);
177 smk->indexes[i] = ast[i]->index; 177 smk->indexes[i] = ast[i]->index;
178 ast[i]->codec->codec_type = CODEC_TYPE_AUDIO; 178 ast[i]->codec->codec_type = CODEC_TYPE_AUDIO;
179 ast[i]->codec->codec_id = (smk->rates[i] & SMK_AUD_PACKED) ? CODEC_ID_SMACKAUDIO : CODEC_ID_PCM_U8; 179 if (smk->rates[i] & SMK_AUD_BINKAUD) {
180 ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A'); 180 ast[i]->codec->codec_id = CODEC_ID_BINKAUDIO_RDFT;
181 } else if (smk->rates[i] & SMK_AUD_USEDCT) {
182 ast[i]->codec->codec_id = CODEC_ID_BINKAUDIO_DCT;
183 } else if (smk->rates[i] & SMK_AUD_PACKED){
184 ast[i]->codec->codec_id = CODEC_ID_SMACKAUDIO;
185 ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A');
186 } else {
187 ast[i]->codec->codec_id = CODEC_ID_PCM_U8;
188 }
181 ast[i]->codec->channels = (smk->rates[i] & SMK_AUD_STEREO) ? 2 : 1; 189 ast[i]->codec->channels = (smk->rates[i] & SMK_AUD_STEREO) ? 2 : 1;
182 ast[i]->codec->sample_rate = smk->rates[i] & 0xFFFFFF; 190 ast[i]->codec->sample_rate = smk->rates[i] & 0xFFFFFF;
183 ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8; 191 ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8;
184 if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8) 192 if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8)
185 ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE; 193 ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;