Fixed sound corruption upon starting the app; we need to continuously

write 'silence' to the sound card until there is available data to use.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3152 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2015-03-17 17:45:08 +00:00
parent 5c23739f00
commit 7c0fc50a2f
3 changed files with 7 additions and 1 deletions

View File

@ -20,6 +20,10 @@
updated continuously. This may also fix issues some people were updated continuously. This may also fix issues some people were
having with triple-buffering in Windows Direct3D, etc. having with triple-buffering in Windows Direct3D, etc.
* Fixed sound corruption that happened when running a ROM for the
first time. This was most obvious under OSX, but occasionally
happened on other systems too.
* Reverted some minor C++11 features (std::regex and cbegin/cend * Reverted some minor C++11 features (std::regex and cbegin/cend
iterators) in a few places, since otherwise GCC 4.9 is required to iterators) in a few places, since otherwise GCC 4.9 is required to
compile Stella, and it isn't available on many systems yet. These compile Stella, and it isn't available on many systems yet. These

View File

@ -365,6 +365,8 @@ void SoundSDL2::callback(void* udata, uInt8* stream, int len)
// So, we need to convert the pointer and half the length // So, we need to convert the pointer and half the length
sound->processFragment((Int16*)stream, (uInt32)len >> 1); sound->processFragment((Int16*)stream, (uInt32)len >> 1);
} }
else
SDL_memset(stream, 0, len); // Write 'silence'
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -2040,7 +2040,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = { 29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 0610; LastUpgradeCheck = 0620;
ORGANIZATIONNAME = net.sourceforge.stella; ORGANIZATIONNAME = net.sourceforge.stella;
}; };
buildConfigurationList = 2D91752109BA903B0026E9FF /* Build configuration list for PBXProject "stella" */; buildConfigurationList = 2D91752109BA903B0026E9FF /* Build configuration list for PBXProject "stella" */;