diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-04-07 18:36:49 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-11-12 10:33:22 -0500 |
commit | bfccd76adb514f6bf3dd4bf7f429ca58000f513e (patch) | |
tree | 224543d24e918dd5a6f5db434a4586175eabaf7d /libavformat/smacker.c | |
parent | 57e590e4b8b94238800b36695f07d5cf4a4832ac (diff) | |
download | ffmpeg-bfccd76adb514f6bf3dd4bf7f429ca58000f513e.tar.gz |
smacker: set channel layout
Diffstat (limited to 'libavformat/smacker.c')
-rw-r--r-- | libavformat/smacker.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/smacker.c b/libavformat/smacker.c index dcca1afd37..17c7c529e7 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -24,6 +24,7 @@ */ #include "libavutil/bswap.h" +#include "libavutil/channel_layout.h" #include "libavutil/intreadwrite.h" #include "avformat.h" #include "internal.h" @@ -191,7 +192,13 @@ static int smacker_read_header(AVFormatContext *s) } else { 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->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) |