Fixed compiler warning and removed some dead code.

Originally committed to SVN as r1101.
This commit is contained in:
Niels Martin Hansen 2007-04-20 21:15:21 +00:00
parent c1cb6e4367
commit 168d08acc2
2 changed files with 1 additions and 14 deletions

View File

@ -314,19 +314,6 @@ __int64 DirectSoundPlayer::GetCurrentPosition() {
DWORD curtime = GetTickCount(); DWORD curtime = GetTickCount();
__int64 tdiff = curtime - startTime; __int64 tdiff = curtime - startTime;
return startPos + tdiff * provider->GetSampleRate() / 1000; return startPos + tdiff * provider->GetSampleRate() / 1000;
// Read position
unsigned long int play,write;
HRESULT res = buffer->GetCurrentPosition(&play,NULL);
if (SUCCEEDED(res)) {
int bytesps = provider->GetBytesPerSample();
write = offset;
if (write < play) write += bufSize;
return playPos + play/bytesps - write/bytesps;
}
// Failed, just return playPos
return playPos;
} }

View File

@ -76,7 +76,7 @@ private:
volatile bool playing; volatile bool playing;
float volume; float volume;
int offset; int offset;
int bufSize; DWORD bufSize;
volatile __int64 playPos; volatile __int64 playPos;
__int64 startPos; __int64 startPos;