| @@ -24,6 +24,7 @@ | |||||
| */ | */ | ||||
| #include "libavutil/bswap.h" | #include "libavutil/bswap.h" | ||||
| #include "libavutil/channel_layout.h" | |||||
| #include "libavutil/intreadwrite.h" | #include "libavutil/intreadwrite.h" | ||||
| #include "avformat.h" | #include "avformat.h" | ||||
| #include "internal.h" | #include "internal.h" | ||||
| @@ -191,7 +192,13 @@ static int smacker_read_header(AVFormatContext *s) | |||||
| } else { | } else { | ||||
| ast[i]->codec->codec_id = AV_CODEC_ID_PCM_U8; | ast[i]->codec->codec_id = AV_CODEC_ID_PCM_U8; | ||||
| } | } | ||||
| ast[i]->codec->channels = (smk->aflags[i] & SMK_AUD_STEREO) ? 2 : 1; | |||||
| if (smk->aflags[i] & SMK_AUD_STEREO) { | |||||
| ast[i]->codec->channels = 2; | |||||
| ast[i]->codec->channel_layout = AV_CH_LAYOUT_STEREO; | |||||
| } else { | |||||
| ast[i]->codec->channels = 1; | |||||
| ast[i]->codec->channel_layout = AV_CH_LAYOUT_MONO; | |||||
| } | |||||
| ast[i]->codec->sample_rate = smk->rates[i]; | ast[i]->codec->sample_rate = smk->rates[i]; | ||||
| ast[i]->codec->bits_per_coded_sample = (smk->aflags[i] & SMK_AUD_16BITS) ? 16 : 8; | 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) | if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == AV_CODEC_ID_PCM_U8) | ||||