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.
This commit is contained in:
John Regan 2017-09-26 08:42:53 -05:00 committed by Max Kellermann
parent 828f5f8384
commit ea80587ddb
2 changed files with 3 additions and 2 deletions

1
NEWS
View File

@ -3,6 +3,7 @@ ver 0.20.11 (not yet released)
- curl: support Content-Type application/xml - curl: support Content-Type application/xml
* decoder * decoder
- ffmpeg: more reliable song duration - ffmpeg: more reliable song duration
- gme: fix track numbering
* fix case insensitive search without libicu * fix case insensitive search without libicu
ver 0.20.10 (2017/08/24) ver 0.20.10 (2017/08/24)

View File

@ -293,13 +293,13 @@ gme_container_scan(Path path_fs)
TagBuilder tag_builder; TagBuilder tag_builder;
auto tail = list.before_begin(); auto tail = list.before_begin();
for (unsigned i = 1; i <= num_songs; ++i) { for (unsigned i = 0; i < num_songs; ++i) {
ScanMusicEmu(emu, i, ScanMusicEmu(emu, i,
add_tag_handler, &tag_builder); add_tag_handler, &tag_builder);
char track_name[64]; char track_name[64];
snprintf(track_name, sizeof(track_name), 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, tail = list.emplace_after(tail, track_name,
tag_builder.Commit()); tag_builder.Commit());
} }