Merge pull request #827 from bnnm/derp

- Fix Ogg looping caused by debug derp
- Fix Ogg looping with wrong granules properly [Aristear Remain (PC)]
This commit is contained in:
bnnm 2021-03-15 23:34:23 +01:00 committed by GitHub
commit 67ba6df121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -201,8 +201,8 @@ void decode_ogg_vorbis(ogg_vorbis_codec_data* data, sample_t* outbuf, int32_t sa
pcm_convert_float_to_16(channels, outbuf, start, rc, pcm_channels, data->disable_reordering);
outbuf += rc * channels;
samples_done += rc;
outbuf += (rc - start) * channels;
samples_done += (rc - start);
#if 0 // alt decoding

View File

@ -545,7 +545,7 @@ VGMSTREAM* init_vgmstream_ogg_vorbis_callbacks(STREAMFILE* sf, ov_callbacks* cal
loop_flag = (loop_start >= 0);
}
else if (strstr(comment,"COMMENT=- loopTime ") == comment) { /* Aristear Remain (PC) */
loop_start = atol(strrchr(comment,' ')+1) * sample_rate / 1000.0f; /* ms to samples */
loop_start = atol(strrchr(comment,' ')+1) / 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
@ -600,7 +600,7 @@ VGMSTREAM* init_vgmstream_ogg_vorbis_callbacks(STREAMFILE* sf, ov_callbacks* cal
else if (loop_end_found)
vgmstream->loop_end_sample = loop_end;
else
vgmstream->loop_end_sample = vgmstream->num_samples - 100000;
vgmstream->loop_end_sample = vgmstream->num_samples;
if (vgmstream->loop_end_sample > vgmstream->num_samples)
vgmstream->loop_end_sample = vgmstream->num_samples;