music & SDL_RWops "magic" for Android [SOLVED] |
Problem with SDL SDL_RWops "magic" for Android |
John
Guest
|
Avoid the combination of SDL_Mixer, SDL_RWops, and assets on Android if
possible. First problem: SDL seek is implemented as a close(), followed by a re-open, then repeatedly reading until it hits the offset. The reason has to do with the assets stream, it's a forward-only, read-only decompression stream. Second problem: SDL_mixer likes to seek() in certain cases as a kind of `probe` to see what the stream does. This wreaks havoc on the assets stream or any other non-trivial stream. Third problem: SDL's seek will mask bad code by clamping to boundaries. SDL_mixer appears to rely on this clamping, and in some cases will seek to extreme offsets such ((size_t)-1). Fourth problem: SDL_mixer triggers some fun reports from valgrind. Fifth problem: it's pretty easy to crash SDL on Android by touching any of the streams after the app is restored from background or orientation has changed. If you are targeting platform 10 or above, you can directly access assets via the direct C api. On 05/25/2012 07:12 PM, William Dyce wrote:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
Problem with SDL SDL_RWops "magic" for Android |
gabomdq
|
2012/5/26 John
We actually had a more gracious system but we had to remove it and replace it by the current hack due to an Android bug. http://bugzilla.libsdl.org/show_bug.cgi?id=1301 -- Gabriel. |
|||||||||||||
|
Re: Problem with SDL SDL_RWops "magic" for Android |
wilbefast
|
Thanks for the reply - yes, mixer is filthy, I know it's good to know in more depth why it's not unsafe to stream from the APK. Unfortunately my phone isn't version 2.3.3 so I can't use API 10. I came up with a filthy work-around however, which you can find here In a nutshell:
Hmm... is this likely to cause me problems now that I'm reading from the filesystem rather than the assets folder? edit: also, blog post http://wilbefast.com/2012/05/29/android-sound-and-music-via-sdl_rwops/#more-1664 |
|||||||||||||||
|