Commit ea80587d authored by John Regan's avatar John Regan Committed by Max Kellermann

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 828f5f83
......@@ -3,6 +3,7 @@ ver 0.20.11 (not yet released)
- curl: support Content-Type application/xml
* decoder
- ffmpeg: more reliable song duration
- gme: fix track numbering
* fix case insensitive search without libicu
ver 0.20.10 (2017/08/24)
......
......@@ -293,13 +293,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