mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-17 11:18:31 +01:00
Parse loop_target manually (get_vgmstream_play_samples is just a helper)
This commit is contained in:
parent
d9fb118412
commit
3c14d3fdb4
@ -871,7 +871,7 @@ int32_t get_vgmstream_play_samples(double looptimes, double fadeseconds, double
|
||||
* Most files cut abruply after the loop, but some do have proper endings.
|
||||
* With looptimes = 1 this option should give the same output vs loop disabled */
|
||||
int loop_count = (int)looptimes; /* no half loops allowed */
|
||||
vgmstream->loop_target = loop_count;
|
||||
//vgmstream->loop_target = loop_count; /* handled externally, as this is into-only */
|
||||
return vgmstream->loop_start_sample
|
||||
+ (vgmstream->loop_end_sample - vgmstream->loop_start_sample) * loop_count
|
||||
+ (vgmstream->num_samples - vgmstream->loop_end_sample);
|
||||
|
@ -292,6 +292,11 @@ int main(int argc, char ** argv) {
|
||||
if (!play && !adxencd && !oggenc && !batchvar) printf("samples to play: %d (%.4lf seconds)\n",len,(double)len/s->sample_rate);
|
||||
fade_samples = fade_seconds * s->sample_rate;
|
||||
|
||||
if (loop_count && fade_ignore) {
|
||||
s->loop_target = (int)loop_count;
|
||||
}
|
||||
|
||||
|
||||
/* slap on a .wav header */
|
||||
if (only_stereo != -1) {
|
||||
make_wav_header((uint8_t*)buf, len, s->sample_rate, 2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user