[ros-diffs] [janderwald] 45488: [DSOUND] - Fix broken assert - Fix calculation of length for the first locked audio buffer

janderwald at svn.reactos.org janderwald at svn.reactos.org
Sun Feb 7 16:57:25 CET 2010


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/secondary.c?rev=45488&r1=45487&r2=45488&view=diff
==============================================================================
--- 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;
 }
 




More information about the Ros-diffs mailing list