[FFmpeg-cvslog] Set channel_layout for S302M.

Carl Eugen Hoyos git at videolan.org
Fri May 13 00:24:39 CEST 2011


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Fri May 13 00:23:00 2011 +0200| [69b6b2d2bc363888957ba8a535bbb7b893894907] | committer: Carl Eugen Hoyos

Set channel_layout for S302M.

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

 libavcodec/s302m.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c
index dd0ec2e..d8b2b38 100644
--- a/libavcodec/s302m.c
+++ b/libavcodec/s302m.c
@@ -64,6 +64,16 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
         avctx->sample_fmt = SAMPLE_FMT_S16;
 
     avctx->channels    = channels;
+    switch(channels) {
+        case 2:
+            avctx->channel_layout = AV_CH_LAYOUT_STEREO;
+            break;
+        case 4:
+            avctx->channel_layout = AV_CH_LAYOUT_QUAD;
+            break;
+        case 8:
+            avctx->channel_layout = AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX;
+    }
     avctx->sample_rate = 48000;
     avctx->bit_rate    = 48000 * avctx->channels * (avctx->bits_per_coded_sample + 4) +
                          32 * (48000 / (buf_size * 8 /



More information about the ffmpeg-cvslog mailing list