[xiph-commits] r11197 - in branches/oggdsf_ce_port/src: lib/codecs/speex/libs/libOOSpeex tests/testOOSpeexDec

illiminable at svn.xiph.org illiminable at svn.xiph.org
Fri Apr 21 02:15:00 PDT 2006


Author: illiminable
Date: 2006-04-21 02:14:52 -0700 (Fri, 21 Apr 2006)
New Revision: 11197

Modified:
   branches/oggdsf_ce_port/src/lib/codecs/speex/libs/libOOSpeex/SpeexDecoder.h
   branches/oggdsf_ce_port/src/tests/testOOSpeexDec/SpeexDecWriter.cpp
Log:
* Fix the test app for speex wrapper

Modified: branches/oggdsf_ce_port/src/lib/codecs/speex/libs/libOOSpeex/SpeexDecoder.h
===================================================================
--- branches/oggdsf_ce_port/src/lib/codecs/speex/libs/libOOSpeex/SpeexDecoder.h	2006-04-21 09:07:16 UTC (rev 11196)
+++ branches/oggdsf_ce_port/src/lib/codecs/speex/libs/libOOSpeex/SpeexDecoder.h	2006-04-21 09:14:52 UTC (rev 11197)
@@ -21,7 +21,8 @@
 		SPEEX_HEADER_OK,
 		SPEEX_COMMENT_OK,
 		SPEEX_EXTRA_HEADER_OK,
-		SPEEX_BAD_HEADER = 64,
+		SPEEX_ERROR_MIN = 64,
+		SPEEX_BAD_HEADER,
 		SPEEX_CORRUPTED_BITSTREAM,
 		SPEEX_CORRUPTED_UNDERFLOW,
 		SPEEX_INVALID_SPEEX_VERSION,

Modified: branches/oggdsf_ce_port/src/tests/testOOSpeexDec/SpeexDecWriter.cpp
===================================================================
--- branches/oggdsf_ce_port/src/tests/testOOSpeexDec/SpeexDecWriter.cpp	2006-04-21 09:07:16 UTC (rev 11196)
+++ branches/oggdsf_ce_port/src/tests/testOOSpeexDec/SpeexDecWriter.cpp	2006-04-21 09:14:52 UTC (rev 11197)
@@ -16,9 +16,15 @@
 
 bool SpeexDecWriter::acceptStampedOggPacket(StampedOggPacket* inPacket)
 {
-	bool retVal = mSpeexDecoder.decodePacket(inPacket, mOutputBuffer, OUTPUT_BUFFER_SIZE);
-	mOutputFile.write((char*)mOutputBuffer, mSpeexDecoder.frameSize() * mSpeexDecoder.numChannels() * sizeof(short));
-	return retVal;
+	SpeexDecoder::eSpeexResult locRes = mSpeexDecoder.decodePacket(inPacket, mOutputBuffer, OUTPUT_BUFFER_SIZE);
+	if (locRes == SpeexDecoder::SPEEX_DATA_OK) {
+		mOutputFile.write((char*)mOutputBuffer, mSpeexDecoder.frameSize() * mSpeexDecoder.numChannels() * sizeof(short));
+		return true;
+	else if (locRes < SpeexDecoder::SPEEX_ERROR_MIN) {
+		return true;
+	} else {
+		return false;
+	}
 }
 bool SpeexDecWriter::acceptOggPage(OggPage* inOggPage)
 {



More information about the commits mailing list