mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 13:31:37 +00:00
Made size of music stream buffer customizable
Use snd_streambuffersize CVAR to set buffer size in kilobytes, from 16 to 1024 Name of existed CVAR from removed FMOD sound backend is used Increased default size of stream buffer to 64 kB like it was in FMOD backend
This commit is contained in:
parent
3d100e6578
commit
f7b8dadedb
1 changed files with 13 additions and 1 deletions
|
@ -79,6 +79,18 @@ protected:
|
|||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
CUSTOM_CVAR(Int, snd_streambuffersize, 64, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
{
|
||||
if (self < 16)
|
||||
{
|
||||
self = 16;
|
||||
}
|
||||
else if (self > 1024)
|
||||
{
|
||||
self = 1024;
|
||||
}
|
||||
}
|
||||
|
||||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
// CODE --------------------------------------------------------------------
|
||||
|
@ -206,7 +218,7 @@ SndFileSong::SndFileSong(FileReader *reader, SoundDecoder *decoder, uint32_t loo
|
|||
Reader = reader;
|
||||
Decoder = decoder;
|
||||
Channels = iChannels == ChannelConfig_Stereo? 2:1;
|
||||
m_Stream = GSnd->CreateStream(Read, 32*1024, iChannels == ChannelConfig_Stereo? 0 : SoundStream::Mono, SampleRate, this);
|
||||
m_Stream = GSnd->CreateStream(Read, snd_streambuffersize * 1024, iChannels == ChannelConfig_Stereo? 0 : SoundStream::Mono, SampleRate, this);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue