mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-20 20:41:08 +01:00
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:
commit
67ba6df121
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user