Fix data race on GetAlbumReplayGain

This commit is contained in:
DataHoarder 2022-07-21 10:14:05 +02:00
parent 84c6c3b064
commit 090c231e72
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -83,6 +83,7 @@ func GetAlbumReplayGain(sources []audio.Source) (albumGain, albumPeak float64, t
wg.Add(1)
go func(source audio.Source) {
defer wg.Done()
var err error
if _, ok := source.(*audio.Int16Source); ok || source.GetBitDepth() == 16 {
for block := range source.ToInt16().GetBlocks() {