Fix some .ogg looping from Astronauts games

This commit is contained in:
bnnm 2021-04-10 19:44:55 +02:00
parent 310a064fd0
commit 92db12dc64

View File

@ -544,14 +544,15 @@ VGMSTREAM* init_vgmstream_ogg_vorbis_callbacks(STREAMFILE* sf, ov_callbacks* cal
loop_start = atol(strrchr(comment,'=')+1) * sample_rate / 1000; /* ms to samples */
loop_flag = (loop_start >= 0);
}
else if (strstr(comment,"COMMENT=- loopTime ") == comment) { /* Aristear Remain (PC) */
loop_start = atol(strrchr(comment,' ')+1) / 1000.0f * sample_rate; /* ms to samples */
else if (strstr(comment,"COMMENT=- loopTime ") == comment || /* Aristear Remain (PC) */
strstr(comment,"COMMENT=-loopTime ") == comment) { /* Hyakki Ryouran no Yakata x Kawarazaki-ke no Ichizoku (PC) */
loop_start = atol(strrchr(comment,'l')) / 1000.0f * sample_rate; /* ms to samples */
loop_flag = (loop_start >= 0);
/* files have all page granule positions -1 except a few close to loop. This throws off
* libvorbis seeking (that uses granules), so we need manual fix = slower. Could be detected
* by checking granules in the first new OggS pages (other games from same dev don't use
* loopTime not have wrong granules though) */
* by checking granules in the first new OggS pages (other games from the same dev don't use
* loopTime nor have wrong granules though) */
force_seek = 1;
}