diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-03 02:11:25 +0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-04-01 20:33:28 +0400 |
commit | 58133bb010c1587515ab4a8bf990760ca28b4dda (patch) | |
tree | f819a438714f917a36ae19e3443b30a92155c17b /libavcodec | |
parent | 43e3e7764c498138c28507c5a7dfcd08c0748633 (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
(cherry picked from commit 51ddf35c9017018e58c15275ff5b129647a0c94d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec')
-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 bf451aa258..f83dd37520 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++) { |