Fix #580 - DSound playback stops before end of selection. Only happened with selections longer than 150 ms and up to 150*BytesPerSample ms, that is, 300 ms for the most common 16 bit audio. The condition used to test whether streaming or one-shot mode should be used didn't take sampledepth into account and compared a number of samples with a buffer length in bytes.

Originally committed to SVN as r1602.
This commit is contained in:
Niels Martin Hansen 2007-10-18 00:33:07 +00:00
parent b77918f832
commit 509732b0c2
1 changed files with 1 additions and 1 deletions

View File

@ -338,7 +338,7 @@ void DirectSoundPlayer::Play(int64_t start,int64_t count) {
FillBuffer(true);
DWORD play_flag = 0;
if (count > bufSize) {
if (count*provider->GetBytesPerSample() > bufSize) {
// Start thread
thread = new DirectSoundPlayerThread(this);
thread->Create();