summaryrefslogtreecommitdiff
path: root/libavcodec/libmp3lame.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-03-30 22:15:50 +0000
committerPaul B Mahol <onemda@gmail.com>2013-04-02 12:14:14 +0000
commit1de11a7cab5346030a134774fbc23b3fc523a003 (patch)
tree6a5a883fb34e522157a8d044f2794272331b2fb7 /libavcodec/libmp3lame.c
parent4dd31f88f513751b13c5090e541a127034a983bb (diff)
downloadffmpeg-1de11a7cab5346030a134774fbc23b3fc523a003.tar.gz
libmp3lame: allow joint stereo to be disabled
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/libmp3lame.c')
-rw-r--r--libavcodec/libmp3lame.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 94e358217f..95771af1ab 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -48,6 +48,7 @@ typedef struct LAMEContext {
int buffer_index;
int buffer_size;
int reservoir;
+ int joint_stereo;
float *samples_flt[2];
AudioFrameQueue afq;
AVFloatDSPContext fdsp;
@@ -101,7 +102,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
lame_set_num_channels(s->gfp, avctx->channels);
- lame_set_mode(s->gfp, avctx->channels > 1 ? JOINT_STEREO : MONO);
+ lame_set_mode(s->gfp, avctx->channels > 1 ? s->joint_stereo ? JOINT_STEREO : STEREO : MONO);
/* sample rate */
lame_set_in_samplerate (s->gfp, avctx->sample_rate);
@@ -263,6 +264,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
{ "reservoir", "Use bit reservoir.", OFFSET(reservoir), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AE },
+ { "joint_stereo", "Use joint stereo.", OFFSET(joint_stereo), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AE },
{ NULL },
};