Update dr_wav to 0.14, adapting to API changes - #3456
Conversation
Adds `Filesystem_Stream::InputStream::GetPosition()` to support the new `onTell` callback for `drwav_init_ex`.
440b6bb to
4420531
Compare
Thanks! This is a reasonable idea, and it is actually slightly helpful for Fedora, because it means that the patch based on this PR, or a future release containing this PR, could be safely merged back to stable releases (currently, Fedora 41/42) even though the breaking Looking at 9345243#diff-665f37409ef2960f9a676f6f9b75ae6423071d6d310b3d2ed8ba99f614180bebR1540, // EasyRPG modification {
#elif defined(WORDS_BIGENDIAN)
return DRWAV_FALSE;
// }it seems like this plumbs in the build system’s endianness check, Lines 891 to 902 in 14f9507 but in the case where we are using a system copy of int n = 1;
return (*(char*)&n) == 1;which should give the same result, potentially at the cost of a few extra instructions, or possibly optimized to the same machine code as |
|
Yeah that EasyRPG modification is not necessary. It works without. We only have it in for our homebrew platforms. Because you find this commit useful I will split it in two so that "modification" is separate and you can pick the other part easier. |
Used on our homebrew platforms for (minor) performance reasons.
|
Thanks! This is great. |
Update dr_wav to 0.14, adapting to API changes
Version 0.14.0 of
dr_wav0.14.0 was recently released, with a breaking API change that affects EasyRPG Player.My motivation for this PR is that I maintain the
dr_libspackage in Fedora, and oureasyrpg-playerpackage is currently built with the system copy ofdr_wav– something we want to do whenever possible. I am preparing to updatedr_libsto providedr_flac0.13.0,dr_mp30.7.0, anddr_wav0.14.0, and I need to either patch dependent packages to work with the new versions (this PR is my attempt to do that), adjust them to go back to using bundled copies (with an explicit justification and upstream issue link), or request and maintain a compat package for the previous versions (preferably not indefinitely).In
dr_wav0.14, the functiondrwav_init_exgains a callback parameterdrwav_tell_proc onTell. I added a newGetPosition()method toFilesystem_Stream::InputStreamand used it to implement this callback. I think I’ve done this correctly, and tests seem to be passing (assuming I’m running them correctly), but review and testing by someone familiar with the code would certainly be appreciated.