[xiph-commits] r10277 - branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder

illiminable at svn.xiph.org illiminable at svn.xiph.org
Sun Oct 23 09:41:29 PDT 2005


Author: illiminable
Date: 2005-10-23 09:41:26 -0700 (Sun, 23 Oct 2005)
New Revision: 10277

Modified:
   branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
Log:
* Move fish sound info gathering to avoid a division by zero
* Fix a casting bug on the intermediate buffer

Modified: branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
===================================================================
--- branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp	2005-10-23 16:33:28 UTC (rev 10276)
+++ branches/oggdsf_new_demux/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp	2005-10-23 16:41:26 UTC (rev 10277)
@@ -122,17 +122,17 @@
 	VorbisDecodeFilter* locFilter = reinterpret_cast<VorbisDecodeFilter*>(locThis->m_pFilter);
 
 	if (locThis->CheckStreaming() == S_OK) {
-		if (! locThis->mBegun) {
-			//locThis->debugLog<<"First Time"<<endl;
-			//Set up fishsound		
-			fish_sound_command (locThis->mFishSound, FISH_SOUND_GET_INFO, &(locThis->mFishInfo), sizeof (FishSoundInfo)); 
-			locThis->mBegun = true;
-			
-			locThis->mNumChannels = locThis->mFishInfo.channels;
-			locThis->mFrameSize = locThis->mNumChannels * SIZE_16_BITS;
-			locThis->mSampleRate = locThis->mFishInfo.samplerate;
+		//if (! locThis->mBegun) {
+		//	//locThis->debugLog<<"First Time"<<endl;
+		//	//Set up fishsound		
+		//	fish_sound_command (locThis->mFishSound, FISH_SOUND_GET_INFO, &(locThis->mFishInfo), sizeof (FishSoundInfo)); 
+		//	locThis->mBegun = true;
+		//	
+		//	locThis->mNumChannels = locThis->mFishInfo.channels;
+		//	locThis->mFrameSize = locThis->mNumChannels * SIZE_16_BITS;
+		//	locThis->mSampleRate = locThis->mFishInfo.samplerate;
 
-		}
+		//}
 
 
 
@@ -143,7 +143,7 @@
 
 
 		//Create a pointer into the buffer		
-		signed short* locShortBuffer = (signed short*)locThis->mDecodedBuffer[locThis->mDecodedByteCount];
+		signed short* locShortBuffer = (signed short*)&locThis->mDecodedBuffer[locThis->mDecodedByteCount];
 		
 		
 		signed short tempInt = 0;
@@ -310,6 +310,19 @@
 	HRESULT locHR = CheckStreaming();
 
 	if (locHR == S_OK) {
+		if (!mBegun) {
+			//locThis->debugLog<<"First Time"<<endl;
+			//Set up fishsound		
+			fish_sound_command (mFishSound, FISH_SOUND_GET_INFO, &(mFishInfo), sizeof (FishSoundInfo)); 
+			mBegun = true;
+			
+			mNumChannels = mFishInfo.channels;
+			mFrameSize = mNumChannels * SIZE_16_BITS;
+			mSampleRate = mFishInfo.samplerate;
+
+		}
+
+
 		BYTE* locBuff = NULL;
 		locHR = inSample->GetPointer(&locBuff);
 
@@ -326,7 +339,7 @@
 			if (locResult != S_OK) {
 				return S_FALSE;
 			}
-			if (locEnd != -1) {
+			if (locEnd > 0) {
 				//Can dump it all downstream now	
 				IMediaSample* locSample;
 				unsigned long locBytesCopied = 0;



More information about the commits mailing list