mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
libmp3lame: allow joint stereo to be disabled
This commit is contained in:
parent
12789d9636
commit
729d821fd8
@ -48,6 +48,7 @@ typedef struct LAMEContext {
|
|||||||
int buffer_index;
|
int buffer_index;
|
||||||
int buffer_size;
|
int buffer_size;
|
||||||
int reservoir;
|
int reservoir;
|
||||||
|
int joint_stereo;
|
||||||
float *samples_flt[2];
|
float *samples_flt[2];
|
||||||
AudioFrameQueue afq;
|
AudioFrameQueue afq;
|
||||||
AVFloatDSPContext fdsp;
|
AVFloatDSPContext fdsp;
|
||||||
@ -96,7 +97,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx)
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
lame_set_num_channels(s->gfp, avctx->channels);
|
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 */
|
/* sample rate */
|
||||||
lame_set_in_samplerate (s->gfp, avctx->sample_rate);
|
lame_set_in_samplerate (s->gfp, avctx->sample_rate);
|
||||||
@ -260,6 +261,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
|||||||
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
|
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
|
||||||
static const AVOption options[] = {
|
static const AVOption options[] = {
|
||||||
{ "reservoir", "Use bit reservoir.", OFFSET(reservoir), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AE },
|
{ "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 },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 55
|
#define LIBAVCODEC_VERSION_MAJOR 55
|
||||||
#define LIBAVCODEC_VERSION_MINOR 41
|
#define LIBAVCODEC_VERSION_MINOR 41
|
||||||
#define LIBAVCODEC_VERSION_MICRO 0
|
#define LIBAVCODEC_VERSION_MICRO 1
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
LIBAVCODEC_VERSION_MINOR, \
|
LIBAVCODEC_VERSION_MINOR, \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user