- ast[i]->codec->codec_type = CODEC_TYPE_AUDIO;
- ast[i]->codec->codec_id = (smk->rates[i] & SMK_AUD_PACKED) ? CODEC_ID_SMACKAUDIO : CODEC_ID_PCM_U8;
- ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A');
- ast[i]->codec->channels = (smk->rates[i] & SMK_AUD_STEREO) ? 2 : 1;
- ast[i]->codec->sample_rate = smk->rates[i] & 0xFFFFFF;
- ast[i]->codec->bits_per_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8;
- if(ast[i]->codec->bits_per_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8)
- ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
- av_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate
- * ast[i]->codec->channels * ast[i]->codec->bits_per_sample / 8);
+ ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ if (smk->aflags[i] & SMK_AUD_BINKAUD) {
+ ast[i]->codec->codec_id = AV_CODEC_ID_BINKAUDIO_RDFT;
+ } else if (smk->aflags[i] & SMK_AUD_USEDCT) {
+ ast[i]->codec->codec_id = AV_CODEC_ID_BINKAUDIO_DCT;
+ } else if (smk->aflags[i] & SMK_AUD_PACKED){
+ ast[i]->codec->codec_id = AV_CODEC_ID_SMACKAUDIO;
+ ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A');
+ } else {
+ ast[i]->codec->codec_id = AV_CODEC_ID_PCM_U8;
+ }
+ ast[i]->codec->channels = (smk->aflags[i] & SMK_AUD_STEREO) ? 2 : 1;
+ ast[i]->codec->sample_rate = smk->rates[i];
+ ast[i]->codec->bits_per_coded_sample = (smk->aflags[i] & SMK_AUD_16BITS) ? 16 : 8;
+ if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == AV_CODEC_ID_PCM_U8)
+ ast[i]->codec->codec_id = AV_CODEC_ID_PCM_S16LE;
+ avpriv_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate
+ * ast[i]->codec->channels * ast[i]->codec->bits_per_coded_sample / 8);