[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11769] branches/soc-2007-hcube/intern/ tinySND/sndfile/sndfileWriter.cpp: Added more error check.

Csaba Hruska csaba.hruska at gmail.com
Tue Aug 21 20:25:21 CEST 2007


Revision: 11769
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11769
Author:   hcube
Date:     2007-08-21 20:25:21 +0200 (Tue, 21 Aug 2007)

Log Message:
-----------
Added more error check.

Modified Paths:
--------------
    branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileWriter.cpp

Modified: branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileWriter.cpp
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileWriter.cpp	2007-08-21 18:24:37 UTC (rev 11768)
+++ branches/soc-2007-hcube/intern/tinySND/sndfile/sndfileWriter.cpp	2007-08-21 18:25:21 UTC (rev 11769)
@@ -52,6 +52,14 @@
 	assert( mSndFile != 0 );
 
 	sf_write_sync( mSndFile );
+
+	int error = sf_error( mSndFile );
+	if( error != SF_ERR_NO_ERROR )
+	{
+		printf( "%s\n", sf_error_number( error ) );
+	}
+	assert( error == SF_ERR_NO_ERROR );
+
 	sf_close( mSndFile );
 	mSndFile = 0;
 
@@ -117,8 +125,15 @@
 
 	mInput->setSampleFormat( oldFormat );
 
-	int count = sf_write_float( mSndFile, mBuffer, framesNum * mNumChannels ) ;
+	int count = sf_writef_float( mSndFile, mBuffer, framesNum ) ;
+
+	int error = sf_error( mSndFile );
+	if( error != SF_ERR_NO_ERROR )
+	{
+		printf( "%s\n", sf_error_number( error ) );
+	}
+	assert( error == SF_ERR_NO_ERROR );
 	
-	assert( count == framesNum * mNumChannels );
+	assert( count == framesNum );
 }
 





More information about the Bf-blender-cvs mailing list