Author: janderwald
Date: Sun Feb 7 16:57:25 2010
New Revision: 45488
URL:
http://svn.reactos.org/svn/reactos?rev=45488&view=rev
Log:
[DSOUND]
- Fix broken assert
- Fix calculation of length for the first locked audio buffer
Modified:
trunk/reactos/dll/directx/dsound_new/secondary.c
Modified: trunk/reactos/dll/directx/dsound_new/secondary.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/dsound_new/sec…
==============================================================================
--- trunk/reactos/dll/directx/dsound_new/secondary.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/dsound_new/secondary.c [iso-8859-1] Sun Feb 7 16:57:25
2010
@@ -263,8 +263,9 @@
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 @@
/* release primary buffer */
PrimaryDirectSoundBuffer_ReleaseLock(This->PrimaryBuffer);
- DPRINT1("SetFormatSuccess PrimaryBuffer %p\n", This->PrimaryBuffer);
+ DPRINT("SetFormatSuccess PrimaryBuffer %p\n", This->PrimaryBuffer);
return DS_OK;
}