diff --git a/d2common/d2fileformats/d2mpq/mpq_stream.go b/d2common/d2fileformats/d2mpq/mpq_stream.go index fca933b2..24ebc295 100644 --- a/d2common/d2fileformats/d2mpq/mpq_stream.go +++ b/d2common/d2fileformats/d2mpq/mpq_stream.go @@ -191,11 +191,8 @@ func decompressMulti(data []byte, expectedLength uint32) []byte { panic("bzip2 decompression not supported") case 0x80: // IMA ADPCM Stereo return d2compression.WavDecompress(data[1:], 2) - //return MpqWavCompression.Decompress(sinput, 2); - //panic("ima adpcm sterio decompression not supported") case 0x40: // IMA ADPCM Mono - //return MpqWavCompression.Decompress(sinput, 1) - panic("mpq wav decompression not supported") + return d2compression.WavDecompress(data[1:], 1) case 0x12: panic("lzma decompression not supported") // Combos diff --git a/main.go b/main.go index a20788b4..a4473818 100644 --- a/main.go +++ b/main.go @@ -83,7 +83,10 @@ func main() { } if len(*profileOption) > 0 { - enableProfiler(*profileOption) + profiler := enableProfiler(*profileOption) + if profiler != nil { + defer profiler.Stop() + } } if *region == 0 { @@ -457,7 +460,7 @@ func loadStrings() error { return nil } -func enableProfiler(profileOption string) { +func enableProfiler(profileOption string) interface{ Stop() } { var options []func(*profile.Profile) switch strings.ToLower(strings.Trim(profileOption, " ")) { case "cpu": @@ -485,6 +488,7 @@ func enableProfiler(profileOption string) { options = append(options, profile.ProfilePath("./pprof/")) if len(options) > 1 { - defer profile.Start(options...).Stop() + return profile.Start(options...) } + return nil }