mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 00:35:18 +03:00
Fix for #197 (non audio chunks > 256 bytes)
This commit is contained in:
parent
f879c54f8e
commit
1be0977330
1 changed files with 7 additions and 4 deletions
|
@ -380,10 +380,13 @@ int AudioQueue::mixWav(AudioContext &context, AudioBuffer *buffer, int volume, u
|
||||||
result = FR_DENIED;
|
result = FR_DENIED;
|
||||||
}
|
}
|
||||||
while (result == FR_OK && memcmp(wavSamplesPtr, "data", 4) != 0) {
|
while (result == FR_OK && memcmp(wavSamplesPtr, "data", 4) != 0) {
|
||||||
result = (size < 256 ? f_read(&context.state.wav.file, wavBuffer, size+8, &read) : FR_DENIED);
|
result = f_lseek(&context.state.wav.file, f_tell(&context.state.wav.file)+size);
|
||||||
if (read != size+8) result = FR_DENIED;
|
if (result == FR_OK) {
|
||||||
wavSamplesPtr = (uint32_t *)(wavBuffer + size);
|
result = f_read(&context.state.wav.file, wavBuffer, 8, &read);
|
||||||
size = wavSamplesPtr[1];
|
if (read != 8) result = FR_DENIED;
|
||||||
|
wavSamplesPtr = (uint32_t *)wavBuffer;
|
||||||
|
size = wavSamplesPtr[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
context.state.wav.size = size;
|
context.state.wav.size = size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue