Commit Graph

18 Commits

Author SHA1 Message Date
Vas Crabb
1c8ba9d5c8 Fixed a few coverity errors, several of which are real bugs. 2021-12-02 08:04:41 +11:00
AJR
0298e5d6c3 Use std::clamp in more source files 2021-08-15 21:32:53 -04:00
Vas Crabb
97b6717027 (nw) Clean up the mess on master
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.
2019-03-26 11:13:37 +11:00
andreasnaive
b380514764 Revert "conflict resolution (nw)"
This reverts commit c24473ddff, reversing
changes made to 009cba4fb8.
2019-03-25 23:13:40 +01:00
Enik Land
dc09b5b25c sdl_sound.cpp: Remove leftover variable (nw) 2019-02-18 15:29:49 -03:00
Vas Crabb
01ccbd89c9 (nw) remove some superfluous const, eliminate a superfluous temp, remove superflous semicolons, etc. and also fix a known broken build script change 2019-02-18 00:48:52 +11:00
Vas Crabb
bc6e3672d1 clean up sdl_sound a bit (nw) 2018-12-25 00:48:08 +11:00
Miodrag Milanović
a45221458d Android compile fix (#4395)
* 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
2018-12-11 19:38:27 -05:00
Celelibi
d9d5839e16 sdl_sound.cpp: Rework the circular buffer
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>
2018-12-09 21:06:58 +01:00
057a3dd61f99517a3afea0051a49cb27994f94d
9788f622e2 Fix sound_sdl::sdl_callback, fill buffer with silence when underflow.
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.
2017-06-25 18:28:43 +00:00
Miodrag Milanovic
ddb290d5f6 NOTICE (TYPE NAME CONSOLIDATION)
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
2016-10-22 13:13:17 +02:00
Miodrag Milanovic
9667c6a8cc std::min and std:max instead of MIN and MAX, also some more macros converted to inline functions (nw) 2016-07-31 14:41:02 +02:00
couriersud
6cb4c9c051 RIP sdlinc.h 2016-05-06 02:41:23 +02:00
Miodrag Milanovic
89c5e1f681 Various cleanups suggested by static analyzer (nw) 2016-04-24 12:58:31 +02:00
Miodrag Milanovic
40e0a1bcb7 Remove SDL 1.2 support (nw) 2016-02-16 16:35:03 +01:00
Miodrag Milanovic
ce75a5d682 removed memory tracking (nw) 2016-01-08 12:41:13 +01:00
Cowering
418d057e97 fix SDL on Windows compile 2015-12-06 13:56:05 -06:00
Miodrag Milanovic
7c19aac60e Rename *.c -> *.cpp in our source (nw) 2015-11-08 12:56:12 +01:00