From 509732b0c2d4c0b2e1a66612da61d66e279dfdbd Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Thu, 18 Oct 2007 00:33:07 +0000 Subject: [PATCH] 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. --- aegisub/audio_player_dsound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aegisub/audio_player_dsound.cpp b/aegisub/audio_player_dsound.cpp index dc891aa45..5fb09e37f 100644 --- a/aegisub/audio_player_dsound.cpp +++ b/aegisub/audio_player_dsound.cpp @@ -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();