Fix CLI -L generating looping .wav with loop end off by +1

This commit is contained in:
bnnm 2020-07-29 20:55:24 +02:00
parent 1aba10efd4
commit a63dccc72e

View File

@ -292,8 +292,13 @@ static void apply_config(VGMSTREAM* vgmstream, cli_config* cfg) {
if (cfg->write_lwav) { if (cfg->write_lwav) {
vcfg.disable_config_override = 1; vcfg.disable_config_override = 1;
cfg->ignore_loop = 1; cfg->ignore_loop = 1;
cfg->lwav_loop_start = vgmstream->loop_start_sample;
cfg->lwav_loop_end = vgmstream->loop_end_sample; if (vgmstream->loop_start_sample < vgmstream->loop_end_sample) {
cfg->lwav_loop_start = vgmstream->loop_start_sample;
cfg->lwav_loop_end = vgmstream->loop_end_sample;
cfg->lwav_loop_end--; /* from spec, +1 is added when reading "smpl" */
}
} }
/* only allowed if manually active */ /* only allowed if manually active */
if (cfg->play_forever) { if (cfg->play_forever) {