Open
Description
With the arrival of capture devices in SDL2, I've had a look at the current code to see how it works, and we can say for sure that parts of the code aren't really pretty. Adding a capture device will break the API anyway, so maybe we can take advantage of this breaking change to make this API enjoyable to use and safer as well. I've noticed several uses of mem::transmute and mem::replace within the API, and they can almost always be replaced by "safe" code like Box::into_raw
. I feel like the API is not Rust-y enough.
For instance, having an AudioCVT in C makes sense, but in Rust we have so many other ways to avoid that.
SDL2_mixer also has its problem with unsoundness and needlessly public struct elements, but we can get on to that later.