aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libmp3lame.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-05-07 21:40:20 +0200
committerAnton Khirnov <anton@khirnov.net>2012-05-14 21:36:11 +0200
commite6694659fc8d0967f8b560afc94cd3cadab4dd49 (patch)
tree7803021a458eff4d9a45c1587f8b36501a9ab1b0 /libavcodec/libmp3lame.c
parent6eeb9a0433d793dbd86c43d3dea1a2f8015f1147 (diff)
downloadffmpeg-e6694659fc8d0967f8b560afc94cd3cadab4dd49.tar.gz
libmp3lame: set supported channel layouts.
Diffstat (limited to 'libavcodec/libmp3lame.c')
-rw-r--r--libavcodec/libmp3lame.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index c7abb99786..8f25438932 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -26,6 +26,7 @@
#include <lame/lame.h>
+#include "libavutil/audioconvert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
@@ -76,11 +77,6 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
if ((s->gfp = lame_init()) == NULL)
return AVERROR(ENOMEM);
- /* channels */
- if (avctx->channels > 2) {
- ret = AVERROR(EINVAL);
- goto error;
- }
lame_set_num_channels(s->gfp, avctx->channels);
lame_set_mode(s->gfp, avctx->channels > 1 ? JOINT_STEREO : MONO);
@@ -308,6 +304,8 @@ AVCodec ff_libmp3lame_encoder = {
AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
.supported_samplerates = libmp3lame_sample_rates,
+ .channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
+ AV_CH_LAYOUT_STEREO },
.long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
.priv_class = &libmp3lame_class,
.defaults = libmp3lame_defaults,