working on variable channel count support (to allow preloading mono samples

in half memory, and to avoid redundant resampling in mono files)
This commit is contained in:
Glenn Maynard
2004-07-24 01:22:10 +00:00
parent 694a4d3e70
commit 27243e074c
9 changed files with 83 additions and 58 deletions
+3 -3
View File
@@ -5,8 +5,7 @@
#include "RageSoundReader_Preload.h"
#include "PrefsManager.h"
const int channels = 2;
const int samplesize = 2 * channels; /* 16-bit */
#define samplesize (2 * channels) /* 16-bit */
/* If a sound is smaller than this, we'll load it entirely into memory. */
const unsigned max_prebuf_size = 1024*256;
@@ -20,7 +19,8 @@ bool SoundReader_Preload::Open(SoundReader *source)
{
ASSERT(source);
samplerate = source->GetSampleRate();
channels = source->GetNumChannels();
/* Check the length, and see if we think it'll fit in the buffer. */
int len = source->GetLength_Fast();
if(len != -1)