summaryrefslogtreecommitdiff
path: root/libavcodec/libmp3lame.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-02-16 22:04:08 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2012-02-20 12:32:30 -0500
commit310c372e12f26df2dbed29a57cdeee13522c8d47 (patch)
tree535db34c1a9a8dfd7cbf3cf832c7c6fe0c5f8840 /libavcodec/libmp3lame.c
parenta4f97be1a9ed80f47ca93ebfc5faaaba658250c9 (diff)
downloadffmpeg-310c372e12f26df2dbed29a57cdeee13522c8d47.tar.gz
libmp3lame: remove unneeded 'stereo' field from Mp3AudioContext
Diffstat (limited to 'libavcodec/libmp3lame.c')
-rw-r--r--libavcodec/libmp3lame.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index 3ac033f758..b8ccb26115 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -35,7 +35,6 @@
typedef struct Mp3AudioContext {
AVClass *class;
lame_global_flags *gfp;
- int stereo;
uint8_t buffer[BUFFER_SIZE];
int buffer_index;
int reservoir;
@@ -48,8 +47,6 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
if (avctx->channels > 2)
return -1;
- s->stereo = avctx->channels > 1 ? 1 : 0;
-
if ((s->gfp = lame_init()) == NULL)
goto err;
lame_set_in_samplerate(s->gfp, avctx->sample_rate);
@@ -60,7 +57,7 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
} else {
lame_set_quality(s->gfp, avctx->compression_level);
}
- lame_set_mode(s->gfp, s->stereo ? JOINT_STEREO : MONO);
+ lame_set_mode(s->gfp, avctx->channels > 1 ? JOINT_STEREO : MONO);
lame_set_brate(s->gfp, avctx->bit_rate / 1000);
if (avctx->flags & CODEC_FLAG_QSCALE) {
lame_set_brate(s->gfp, 0);
@@ -153,7 +150,7 @@ static int MP3lame_encode_frame(AVCodecContext *avctx, unsigned char *frame,
/* lame 3.91 dies on '1-channel interleaved' data */
if (data) {
- if (s->stereo) {
+ if (avctx->channels > 1) {
lame_result = lame_encode_buffer_interleaved(s->gfp, data,
avctx->frame_size,
s->buffer + s->buffer_index,