diff --git a/stepmania/src/arch/Sound/DSoundHelpers.cpp b/stepmania/src/arch/Sound/DSoundHelpers.cpp index 3f155120f2..f812665a13 100644 --- a/stepmania/src/arch/Sound/DSoundHelpers.cpp +++ b/stepmania/src/arch/Sound/DSoundHelpers.cpp @@ -306,9 +306,18 @@ void DSoundBuf::SetVolume(float vol) if( volume == new_volume ) return; - volume = new_volume; - buf->SetVolume( volume ); + HRESULT hr = buf->SetVolume( volume ); + if( FAILED(hr) ) + { + static bool bWarned = false; + if( !bWarned ) + LOG->Warn( hr_ssprintf(hr, "DirectSoundBuffer::SetVolume(%i) failed", volume) ); + bWarned = true; + return; + } + + volume = new_volume; } /* Determine if "pos" is between "start" and "end", for a circular buffer. */