[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11701] branches/soc-2007-hcube/intern/ tinySND: bugfix: dont call callback if the device is disabled.

Csaba Hruska csaba.hruska at gmail.com
Sun Aug 19 17:02:58 CEST 2007


Revision: 11701
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11701
Author:   hcube
Date:     2007-08-19 17:02:58 +0200 (Sun, 19 Aug 2007)

Log Message:
-----------
bugfix: dont call callback if the device is disabled.

Modified Paths:
--------------
    branches/soc-2007-hcube/intern/tinySND/intern/SND_FXDuplicator.cpp
    branches/soc-2007-hcube/intern/tinySND/portaudio/portaudioDevice.cpp
    branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp

Modified: branches/soc-2007-hcube/intern/tinySND/intern/SND_FXDuplicator.cpp
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/intern/SND_FXDuplicator.cpp	2007-08-19 15:02:08 UTC (rev 11700)
+++ branches/soc-2007-hcube/intern/tinySND/intern/SND_FXDuplicator.cpp	2007-08-19 15:02:58 UTC (rev 11701)
@@ -71,7 +71,7 @@
 
 float* SND_FXDuplicator::getPCMDataPtr( int framesNum )
 {
-	assert( mBuffer == 0 || mBufferSize == framesNum );
+//	assert( mBuffer == 0 || mBufferSize == framesNum );
 	
  	// call callback
 	if( mCallback != 0 )

Modified: branches/soc-2007-hcube/intern/tinySND/portaudio/portaudioDevice.cpp
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/portaudio/portaudioDevice.cpp	2007-08-19 15:02:08 UTC (rev 11700)
+++ branches/soc-2007-hcube/intern/tinySND/portaudio/portaudioDevice.cpp	2007-08-19 15:02:58 UTC (rev 11701)
@@ -124,12 +124,12 @@
 
     
  	// call callback
-	if( mCallback != 0 )
+	if( mIsEnabled && mCallback != 0 )
 	{
 		(*mCallback)( framesNum, mUserData1, mUserData2 );
 	}
  
-	if( mInput )
+	if( mIsEnabled && mInput != 0 )
 	{
 	 	mInput->fillBuffer( (char*)outputBuffer, framesNum );
 	}

Modified: branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp	2007-08-19 15:02:08 UTC (rev 11700)
+++ branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp	2007-08-19 15:02:58 UTC (rev 11701)
@@ -113,12 +113,12 @@
     int framesNum = len / mAudioSpec.channels / 2; // requested data len per channel
     
  	// call callback
-	if( mCallback != 0 )
+	if( mIsEnabled && mCallback != 0 )
 	{
 		(*mCallback)( framesNum, mUserData1, mUserData2 );
 	}
  
-	if( mInput )
+	if( mIsEnabled && mInput != 0 )
 	{
 	 	mInput->fillBuffer( (char*)stream, framesNum );
 	}





More information about the Bf-blender-cvs mailing list