Commit bd50a0d2 authored by John Regan's avatar John Regan

GME Plugin: fix track numbering

GME starts all track indexes at zero, but subtune prefixes start at one. This fixes an off-by-one error during track enumeration.
parent 9256e748
......@@ -319,13 +319,13 @@ gme_container_scan(Path path_fs)
TagBuilder tag_builder;
auto tail = list.before_begin();
for (unsigned i = 1; i <= num_songs; ++i) {
for (unsigned i = 0; i < num_songs; ++i) {
ScanMusicEmu(emu, i,
add_tag_handler, &tag_builder);
char track_name[64];
snprintf(track_name, sizeof(track_name),
SUBTUNE_PREFIX "%03u.%s", i, subtune_suffix);
SUBTUNE_PREFIX "%03u.%s", i+1, subtune_suffix);
tail = list.emplace_after(tail, track_name,
tag_builder.Commit());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment