1
1
mirror of https://github.com/wader/fq.git synced 2024-12-23 13:22:58 +03:00

Fix decoding of FLAC raw entropy partition

This commit is contained in:
Martijn van Beurden 2022-08-18 10:09:49 +02:00
parent 411c970093
commit 3f209c46ca
2 changed files with 7 additions and 4 deletions

View File

@ -2,9 +2,6 @@ package flac
// https://xiph.org/flac/format.html
// https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench
// TODO:
// 16 - Part 6 of Ladybug Castle (partition order 8 with escape codes)
// 32 - Part 5 of The Four of Us Are Dying (partition order 8 with escape codes)
import (
"bytes"

View File

@ -463,7 +463,13 @@ func frameDecode(d *decode.D, in interface{}) interface{} {
if riceParameter == riceEscape {
escapeSampleSize := int(d.FieldU5("escape_sample_size"))
d.FieldRawLen("samples", int64(count*escapeSampleSize))
d.RangeFn(d.Pos(), int64(count*escapeSampleSize), func(d *decode.D) {
d.FieldRawLen("samples", int64(count*escapeSampleSize))
})
for j := 0; j < count; j++ {
samples[n] = d.S(escapeSampleSize)
n++
}
} else {
samplesStart := d.Pos()
for j := 0; j < count; j++ {