From 11c549d5269f2e293e57e86a1517fecf473224a5 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 7 Feb 2010 15:57:25 +0000 Subject: [PATCH] [DSOUND] - Fix broken assert - Fix calculation of length for the first locked audio buffer svn path=/trunk/; revision=45488 --- reactos/dll/directx/dsound_new/secondary.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reactos/dll/directx/dsound_new/secondary.c b/reactos/dll/directx/dsound_new/secondary.c index a3fe2b17a62..4474c2665ea 100644 --- a/reactos/dll/directx/dsound_new/secondary.c +++ b/reactos/dll/directx/dsound_new/secondary.c @@ -263,8 +263,9 @@ SecondaryDirectSoundBuffer8Impl_fnLock( else { ASSERT(dwOffset < This->BufferSize); - ASSERT(dwBytes < This->BufferSize); - ASSERT(dwBytes + dwOffset <= This->BufferSize); + ASSERT(dwBytes <= This->BufferSize); + + dwBytes = min(This->BufferSize - dwOffset, dwBytes); *ppvAudioPtr1 = This->Buffer + dwOffset; *pdwAudioBytes1 = dwBytes; @@ -316,7 +317,7 @@ SecondaryDirectSoundBuffer8Impl_fnPlay( /* release primary buffer */ PrimaryDirectSoundBuffer_ReleaseLock(This->PrimaryBuffer); - DPRINT1("SetFormatSuccess PrimaryBuffer %p\n", This->PrimaryBuffer); + DPRINT("SetFormatSuccess PrimaryBuffer %p\n", This->PrimaryBuffer); return DS_OK; }