From 302b264b1343119b4eb99baeb925fce5a7df6312 Mon Sep 17 00:00:00 2001 From: bnnm Date: Wed, 6 Nov 2019 23:06:38 +0100 Subject: [PATCH] Add base_offset to coef_offset in TXTH --- src/meta/txth.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/meta/txth.c b/src/meta/txth.c index e441efb2..e4c654ee 100644 --- a/src/meta/txth.c +++ b/src/meta/txth.c @@ -1058,9 +1058,9 @@ static int parse_keyval(STREAMFILE * streamFile_, txth_header * txth, const char /* COEFS */ else if (is_string(key,"coef_offset")) { if (!parse_num(txth->streamHead,txth,val, &txth->coef_offset)) goto fail; - /* special subsong adjustment */ + /* special adjustment */ if (txth->subsong_offset) - txth->coef_offset = txth->coef_offset + txth->subsong_offset * (txth->target_subsong - 1); + txth->coef_offset = txth->base_offset + txth->coef_offset + txth->subsong_offset * (txth->target_subsong - 1); } else if (is_string(key,"coef_spacing")) { if (!parse_num(txth->streamHead,txth,val, &txth->coef_spacing)) goto fail; @@ -1084,9 +1084,9 @@ static int parse_keyval(STREAMFILE * streamFile_, txth_header * txth, const char else if (is_string(key,"hist_offset")) { if (!parse_num(txth->streamHead,txth,val, &txth->hist_offset)) goto fail; txth->hist_set = 1; - /* special subsong adjustment */ + /* special adjustment */ if (txth->subsong_offset) - txth->hist_offset = txth->hist_offset + txth->subsong_offset * (txth->target_subsong - 1); + txth->hist_offset = txth->base_offset + txth->hist_offset + txth->subsong_offset * (txth->target_subsong - 1); } else if (is_string(key,"hist_spacing")) { if (!parse_num(txth->streamHead,txth,val, &txth->hist_spacing)) goto fail; @@ -1109,9 +1109,9 @@ static int parse_keyval(STREAMFILE * streamFile_, txth_header * txth, const char else if (is_string(key,"name_offset")) { if (!parse_num(txth->streamHead,txth,val, &txth->name_offset)) goto fail; txth->name_offset_set = 1; - /* special subsong adjustment */ + /* special adjustment */ if (txth->subsong_offset) - txth->name_offset = txth->name_offset + txth->subsong_offset * (txth->target_subsong - 1); + txth->name_offset = txth->base_offset + txth->name_offset + txth->subsong_offset * (txth->target_subsong - 1); } else if (is_string(key,"name_size")) { if (!parse_num(txth->streamHead,txth,val, &txth->name_size)) goto fail;