mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-25 07:20:10 +01:00
Fix disabling looping with layered layouts
This commit is contained in:
parent
c204127332
commit
3b5be9d28a
@ -921,11 +921,30 @@ void vgmstream_force_loop(VGMSTREAM* vgmstream, int loop_flag, int loop_start_sa
|
||||
vgmstream->loop_ch = calloc(vgmstream->channels,sizeof(VGMSTREAMCHANNEL));
|
||||
/* loop_ch will be populated when decoded samples reach loop start */
|
||||
}
|
||||
else {
|
||||
/* not important though */
|
||||
free(vgmstream->loop_ch);
|
||||
vgmstream->loop_ch = NULL;
|
||||
}
|
||||
|
||||
vgmstream->loop_flag = loop_flag;
|
||||
if (loop_flag) {
|
||||
vgmstream->loop_start_sample = loop_start_sample;
|
||||
vgmstream->loop_end_sample = loop_end_sample;
|
||||
} else {
|
||||
vgmstream->loop_start_sample = 0;
|
||||
vgmstream->loop_end_sample = 0;
|
||||
}
|
||||
|
||||
/* propagate changes to layouts that need them */
|
||||
if (vgmstream->layout_type == layout_layered) {
|
||||
int i;
|
||||
layered_layout_data *data = vgmstream->layout_data;
|
||||
for (i = 0; i < data->layer_count; i++) {
|
||||
vgmstream_force_loop(data->layers[i], loop_flag, loop_start_sample, loop_end_sample);
|
||||
}
|
||||
}
|
||||
/* segmented layout only works (ATM) with exact/header loop, full loop or no loop */
|
||||
}
|
||||
|
||||
/* Decode data into sample buffer */
|
||||
|
Loading…
Reference in New Issue
Block a user