This effectively reverts b380514764 and
c24473ddff, restoring the state at
598cd52272.
Before pushing, please check that what you're about to push is sane.
Check your local commit log and ensure there isn't anything out-of-place
before pushing to mainline. When things like this happen, it wastes
everyone's time. I really don't need this in a week when real work™ is
busting my balls and I'm behind where I want to be with preparing for
MAME release.
* Fix compile for Android, set API to 24
* Update Android Studio project to API 24
* Fixed project file to latest Android Studio
* fix build with gradle alone
Previous code had several oddities. Like checks against buffer overflows
/ underflows done at several places in the code, usage of a spinlock,
unnecessary use of "volatile" qualifier, redundant informations about
the circular buffer and exposed details about the split nature of ranges
in the buffer. This lead to an unlikely deadlock once in a great while.
Signed-off-by: Celelibi <celelibi@gmail.com>
The problem is most noticeable when you are saving state, and the
save takes a relatively long time, short period of audio gets played
repeatedly, which is usually unpleasant.
I found out it's caused by sdl_sound::sdl_callback not fill the audio
buffer with silence when underflow occurs. According to
https://wiki.libsdl.org/SDL_AudioSpec, if there's nothing to play,
the callback should fill the buffer with silence.
I tested this change and the problem is gone.
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8
also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8