diff options
author | Diegoisawesome <diego@domoreaweso.me> | 2020-02-18 20:59:08 -0800 |
---|---|---|
committer | Diegoisawesome <diego@domoreaweso.me> | 2020-02-18 20:59:08 -0800 |
commit | 437cb7c4523584bc3c118bfffc9d6c8a6d42a270 (patch) | |
tree | 7c386216c04e25c2cf6a96edfd1e7c09d3b95899 /tools/aif2pcm/main.c | |
parent | 3456578c0fac0e6a122898bb5f44e08bb835f934 (diff) |
Fix aif2pcm Pascal string bug, allow flexibility in marker names for loop
Diffstat (limited to 'tools/aif2pcm/main.c')
-rw-r--r-- | tools/aif2pcm/main.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/aif2pcm/main.c b/tools/aif2pcm/main.c index 51dbf1bb9..f2e2349d0 100644 --- a/tools/aif2pcm/main.c +++ b/tools/aif2pcm/main.c @@ -238,18 +238,17 @@ void read_aif(struct Bytes *aif, AifData *aif_data) char *marker_name = (char *)malloc((marker_name_size + 1) * sizeof(char)); memcpy(marker_name, &aif->data[pos], marker_name_size); marker_name[marker_name_size] = '\0'; - pos += marker_name_size; + pos += marker_name_size + !(marker_name_size & 1); - if (strcmp(marker_name, "START") == 0) + if (i == 0) { aif_data->loop_offset = marker_position; aif_data->has_loop = true; } - else if (strcmp(marker_name, "END") == 0) + else if (i == 1) { - if (!aif_data->has_loop) { + if (marker_position < aif_data->loop_offset) { aif_data->loop_offset = marker_position; - aif_data->has_loop = true; } aif_data->num_samples = marker_position; } |