Pārlūkot izejas kodu

- fixed hanging snd_StopStream in some cases when DirectSound is in use

git-svn-id: http://zengl.googlecode.com/svn/branches/0.3.x@1958 6573c10b-8653-0410-9706-d32479e959fb
dr.andru 12 gadi atpakaļ
vecāks
revīzija
429ad77060
4 mainītis faili ar 10 papildinājumiem un 7 dzēšanām
  1. 2 2
      src/Lazarus/ZenGL-win.lpi
  2. BIN
      src/ZenGL.res
  3. 3 3
      src/zgl_main.pas
  4. 5 2
      src/zgl_sound.pas

+ 2 - 2
src/Lazarus/ZenGL-win.lpi

@@ -16,9 +16,9 @@
     <VersionInfo>
       <UseVersionInfo Value="True"/>
       <MinorVersionNr Value="3"/>
-      <RevisionNr Value="6"/>
+      <RevisionNr Value="7"/>
       <CharSet Value="04B0"/>
-      <StringTable CompanyName="Kemka Andrey aka Andru" FileDescription="Cross-platform game development library" InternalName="ZenGL" LegalCopyright="Kemka Andrey aka Andru" OriginalFilename="ZenGL" ProductName="ZenGL" ProductVersion="0.3.6"/>
+      <StringTable CompanyName="Kemka Andrey aka Andru" FileDescription="Cross-platform game development library" InternalName="ZenGL" LegalCopyright="Kemka Andrey aka Andru" OriginalFilename="ZenGL" ProductName="ZenGL" ProductVersion="0.3.7"/>
     </VersionInfo>
     <BuildModes Count="4">
       <Item1 Name="Release" Default="True"/>

BIN
src/ZenGL.res


+ 3 - 3
src/zgl_main.pas

@@ -48,11 +48,11 @@ uses
   zgl_types;
 
 const
-  cs_ZenGL    = 'ZenGL 0.3.6 [ End of the World ]';
-  cs_Date     = '2012.12.21';
+  cs_ZenGL    = 'ZenGL 0.3.7';
+  cs_Date     = '2012.12.29';
   cv_major    = 0;
   cv_minor    = 3;
-  cv_revision = 6;
+  cv_revision = 7;
 
   // zgl_Reg
   SYS_APP_INIT           = $000001;

+ 5 - 2
src/zgl_sound.pas

@@ -1239,6 +1239,7 @@ function snd_ProcStream( data : Pointer ) : LongInt; {$IFDEF USE_EXPORT_C} regis
     b1Size, b2Size : LongWord;
     position       : LongWord;
     fillSize       : LongWord;
+    events         : array[ 0..1 ] of LongWord;
   {$ENDIF}
 
   procedure LoopStream( _buffer : PByteArray; _bufferSize : LongWord );
@@ -1335,7 +1336,7 @@ begin
       b1Size := 0;
       b2Size := 0;
 
-      if ( fillSize > 0 {some drivers don't know what is standard...} ) and ( sfSource[ id ].Lock( sfLastPos[ id ], fillSize, block1, b1Size, block2, b2Size, 0 ) = DS_OK ) Then
+      if ( fillSize > 0 {some drivers are stupid...} ) and ( sfSource[ id ].Lock( sfLastPos[ id ], fillSize, block1, b1Size, block2, b2Size, 0 ) = DS_OK ) Then
         begin
           sfLastPos[ id ] := position;
 
@@ -1357,7 +1358,9 @@ begin
               {$IFNDEF USE_OPENAL}
               sfNotifyPos[ id ].dwOffset := bytesRead;
               ResetEvent( sfNotifyEvent[ id ] );
-              WaitForSingleObject( sfNotifyEvent[ id ], INFINITE );
+              events[ 0 ] := sfNotifyEvent[ id ];
+              events[ 1 ] := LongWord( sfEvent[ id ] );
+              WaitForMultipleObjects( 2, @events[ 0 ], FALSE, INFINITE );
               sfSource[ id ].Stop();
               {$ENDIF}
               thread_CSEnter( sfCS[ id ] );