diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-03 02:11:25 +0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-04 03:20:10 +0400 |
commit | 51ddf35c9017018e58c15275ff5b129647a0c94d (patch) | |
tree | d03df73ed8173b9ee1e76d26e75977e9978fb260 /libavcodec/wmaenc.c | |
parent | 8ed7488ea39a4ab60045e679ad5efa6a7b81ed98 (diff) |
wmaenc: fix m/s stereo encoding for the first frame
We need to set ms_stereo in encode_init() in order to avoid incorrectly
encoding the first frame as non-m/s while flagging it as m/s. Fixes an
uncomfortable pop in the left channel at the start of playback.
CC:libav-stable@libav.org
Diffstat (limited to 'libavcodec/wmaenc.c')
-rw-r--r-- | libavcodec/wmaenc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 789f112aee..6fd3494016 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -70,6 +70,8 @@ static int encode_init(AVCodecContext * avctx){ s->use_exp_vlc = flags2 & 0x0001; s->use_bit_reservoir = flags2 & 0x0002; s->use_variable_block_len = flags2 & 0x0004; + if (avctx->channels == 2) + s->ms_stereo = 1; ff_wma_init(avctx, flags2); @@ -191,7 +193,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], } if (s->nb_channels == 2) { - put_bits(&s->pb, 1, s->ms_stereo= 1); + put_bits(&s->pb, 1, !!s->ms_stereo); } for(ch = 0; ch < s->nb_channels; ch++) { |