[FFmpeg-cvslog] sierravmd: set channel layout

Justin Ruggles git at videolan.org
Tue Nov 13 11:18:04 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sat Apr  7 18:32:13 2012 -0400| [a634896cf81b8d057a526d6ad24eb9bdfe46a855] | committer: Justin Ruggles

sierravmd: set channel layout

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a634896cf81b8d057a526d6ad24eb9bdfe46a855
---

 libavformat/sierravmd.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 6490fdd..359282c 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) {



More information about the ffmpeg-cvslog mailing list