From 76320010f441c03dbb1e3b34f82c64c097233a76 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 17 Jun 2017 23:10:06 +0900 Subject: [PATCH] audio/mp3: Bug fix: LR was swapped --- audio/mp3/l3.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/audio/mp3/l3.go b/audio/mp3/l3.go index 51ecfdf85..4c4201506 100644 --- a/audio/mp3/l3.go +++ b/audio/mp3/l3.go @@ -599,15 +599,18 @@ func (f *frame) l3SubbandSynthesis(gr int, ch int, out []uint32) { } samp &= 0xffff s := uint32(samp) - if ch == 0 { /* This function must be called for channel 0 first */ - /* We always run in stereo mode,& duplicate channels here for mono */ + // This function must be called for channel 0 first. + if ch == 0 { + // We always run in stereo mode,& duplicate channels here for mono. if nch == 1 { out[32*ss+i] = (s << 16) | (s) } else { - out[32*ss+i] = s << 16 + // Note that this is different from original PDMP3. + // Samples are set in little endian order here. + out[32*ss+i] = s } } else { - out[32*ss+i] |= s + out[32*ss+i] |= (s << 16) } } }