X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fs302m.c;h=5058ba0fbc8b878ae230ced6ff5cb2c09bb8548f;hb=78e08fd340e03b49f75e1ac31c20cc21434794bd;hp=132c09493585e3c54cb74b519c9b4b4820dbe558;hpb=d5c62122a7b26704bf867a1262df358623bf5edf;p=ffmpeg diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c index 132c0949358..5058ba0fbc8 100644 --- a/libavcodec/s302m.c +++ b/libavcodec/s302m.c @@ -3,20 +3,20 @@ * Copyright (c) 2008 Laurent Aimar * Copyright (c) 2009 Baptiste Coudurier * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -69,6 +69,19 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf, avctx->sample_fmt = AV_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 6: + avctx->channel_layout = AV_CH_LAYOUT_5POINT1_BACK; + 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 /