diff --git a/src/meta/riff.c b/src/meta/riff.c index 1a91faea..dcbbcd2b 100644 --- a/src/meta/riff.c +++ b/src/meta/riff.c @@ -169,6 +169,10 @@ static int read_fmt(int big_endian, STREAMFILE* sf, off_t offset, riff_fmt_chunk case 0x0002: /* MSADPCM */ if (fmt->bps == 4) { + /* ADPCMWAVEFORMAT extra data: + * - samples per frame (16b) + * - num coefs (16b), always 7 + * - N x2 coefs (configurable but in practice fixed) */ fmt->coding_type = coding_MSADPCM; if (!msadpcm_check_coefs(sf, fmt->offset + 0x08 + 0x14)) goto fail; @@ -180,7 +184,7 @@ static int read_fmt(int big_endian, STREAMFILE* sf, off_t offset, riff_fmt_chunk goto fail; } break; - case 0x003: /* floating point PCM */ + case 0x0003: /* floating point PCM */ if (fmt->bps == 32) { fmt->coding_type = coding_PCMFLOAT; } else { @@ -190,6 +194,8 @@ static int read_fmt(int big_endian, STREAMFILE* sf, off_t offset, riff_fmt_chunk break; case 0x0011: /* MS-IMA ADPCM [Layton Brothers: Mystery Room (iOS/Android)] */ + /* IMAADPCMWAVEFORMAT extra data: + * - samples per frame (16b) */ if (fmt->bps != 4) goto fail; fmt->coding_type = coding_MS_IMA; break; diff --git a/src/meta/txth.c b/src/meta/txth.c index c7b3052c..3e001604 100644 --- a/src/meta/txth.c +++ b/src/meta/txth.c @@ -841,7 +841,7 @@ static void set_body_chunk(txth_header* txth) { if (!txth->sf_body) return; - /* treat chunks as subsongs */ + /* treat chunks as subsongs (less subsongs than chunks could be allowed to ignore some chunks but it's kinda odd) */ if (txth->subsong_count > 1 && txth->subsong_count == txth->chunk_count) txth->chunk_number = txth->target_subsong; if (txth->chunk_number == 0)