mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-29 19:37:30 +01:00
Allow repeated VGMSTREAMs in segment layout
This commit is contained in:
parent
e473e7aba9
commit
5d8d462067
@ -203,13 +203,23 @@ fail:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void free_layout_segmented(segmented_layout_data *data) {
|
void free_layout_segmented(segmented_layout_data *data) {
|
||||||
int i;
|
int i, j;
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data->segments) {
|
if (data->segments) {
|
||||||
for (i = 0; i < data->segment_count; i++) {
|
for (i = 0; i < data->segment_count; i++) {
|
||||||
|
int is_repeat = 0;
|
||||||
|
|
||||||
|
/* segments are allowed to be repeated so don't close the same thing twice */
|
||||||
|
for (j = 0; j < i; j++) {
|
||||||
|
if (data->segments[i] == data->segments[j])
|
||||||
|
is_repeat = 1;
|
||||||
|
}
|
||||||
|
if (is_repeat)
|
||||||
|
continue;
|
||||||
|
|
||||||
close_vgmstream(data->segments[i]);
|
close_vgmstream(data->segments[i]);
|
||||||
}
|
}
|
||||||
free(data->segments);
|
free(data->segments);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user