summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-04-07 18:32:13 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2012-11-12 10:33:21 -0500
commita634896cf81b8d057a526d6ad24eb9bdfe46a855 (patch)
treea268b31db76d1a0576a4558f8bf10762d68443c6
parentc1ac602d53ab250fd1ef37867e18191c55cc5e4f (diff)
downloadffmpeg-a634896cf81b8d057a526d6ad24eb9bdfe46a855.tar.gz
sierravmd: set channel layout
-rw-r--r--libavformat/sierravmd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 6490fddc5d..359282c875 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -27,6 +27,7 @@
* http://www.pcisys.net/~melanson/codecs/
*/
+#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@@ -132,7 +133,13 @@ static int vmd_read_header(AVFormatContext *s)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = AV_CODEC_ID_VMDAUDIO;
st->codec->codec_tag = 0; /* no fourcc */
- st->codec->channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1;
+ if (vmd->vmd_header[811] & 0x80) {
+ st->codec->channels = 2;
+ st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ } else {
+ st->codec->channels = 1;
+ st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ }
st->codec->sample_rate = vmd->sample_rate;
st->codec->block_align = AV_RL16(&vmd->vmd_header[806]);
if (st->codec->block_align & 0x8000) {