Revision: 15821
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15821
Author:   scourage
Date:     2008-07-27 22:17:39 +0200 (Sun, 27 Jul 2008)

Log Message:
-----------
wave reader fix

Modified Paths:
--------------
    branches/sound-branch/extern/tinySND/core/SND_WavReader.cpp
    branches/sound-branch/extern/tinySND/core/SND_WavReader.h
    branches/sound-branch/extern/tinySND/make/msvc_7_0/tinySND.vcproj
    branches/sound-branch/extern/tinySND/sdl/sdlDevice.cpp
    branches/sound-branch/intern/soundsystem/SND_factory.cpp
    branches/sound-branch/intern/soundsystem/make/msvc_7_0/soundsystem.vcproj

Modified: branches/sound-branch/extern/tinySND/core/SND_WavReader.cpp
===================================================================
--- branches/sound-branch/extern/tinySND/core/SND_WavReader.cpp 2008-07-27 
20:09:57 UTC (rev 15820)
+++ branches/sound-branch/extern/tinySND/core/SND_WavReader.cpp 2008-07-27 
20:17:39 UTC (rev 15821)
@@ -1,5 +1,8 @@
 #include <stdint.h> 
 #include <stdio.h>
+#include <string>
+#include <assert.h>
+
 #include "SND_WavReader.h"
 
 /*
@@ -230,14 +233,14 @@
       return;
    }
    
-   memcpy(mData, buffer, header->dataLength);
+   memcpy(mData, buffer, header->lengthData);
    
    //TODO get data
    
    mNumChannels = header->numChannels;
    mSampleRate=header->sampleRate;
    mBitRate=header->bitsPerSample;
-       mNumFrames = header->dataLength/mBitRate/8/mNumChannels;
+       mNumFrames = header->lengthData/mBitRate/8/mNumChannels;
        mDuration = float(mNumFrames)/float(mSampleRate);
        mIsSeekable = true;
        mIsSupported = true;

Modified: branches/sound-branch/extern/tinySND/core/SND_WavReader.h
===================================================================
--- branches/sound-branch/extern/tinySND/core/SND_WavReader.h   2008-07-27 
20:09:57 UTC (rev 15820)
+++ branches/sound-branch/extern/tinySND/core/SND_WavReader.h   2008-07-27 
20:17:39 UTC (rev 15821)
@@ -17,6 +17,7 @@
    
 private:
        bool    mIsSupported;
+   char* mData;
 };
 
 #endif // __SND_WAVREADER_H__

Modified: branches/sound-branch/extern/tinySND/make/msvc_7_0/tinySND.vcproj
===================================================================
--- branches/sound-branch/extern/tinySND/make/msvc_7_0/tinySND.vcproj   
2008-07-27 20:09:57 UTC (rev 15820)
+++ branches/sound-branch/extern/tinySND/make/msvc_7_0/tinySND.vcproj   
2008-07-27 20:17:39 UTC (rev 15821)
@@ -107,7 +107,8 @@
                                
AssemblerListingLocation="..\..\..\..\..\build\msvc_7\extern\tinySND\debug\"
                                
ObjectFile="..\..\..\..\..\build\msvc_7\extern\tinySND\debug\"
                                
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_7\extern\tinySND\debug\"
-                               WarningLevel="4"/>
+                               WarningLevel="4"
+                               DebugInformationFormat="3"/>
                        <Tool
                                Name="VCCustomBuildTool"/>
                        <Tool

Modified: branches/sound-branch/extern/tinySND/sdl/sdlDevice.cpp
===================================================================
--- branches/sound-branch/extern/tinySND/sdl/sdlDevice.cpp      2008-07-27 
20:09:57 UTC (rev 15820)
+++ branches/sound-branch/extern/tinySND/sdl/sdlDevice.cpp      2008-07-27 
20:17:39 UTC (rev 15821)
@@ -47,7 +47,7 @@
        wanted.freq = 44100;
        wanted.format = AUDIO_S16SYS;
        wanted.channels = 2;    // 1 = mono, 2 = stereo 
-       wanted.samples = 1024;  // Good low-latency value for callback 
+       wanted.samples = 4096;  // Good low-latency value for callback 
        wanted.callback = sdlDevice::fill_audio;
        wanted.userdata = this;
 
@@ -91,7 +91,7 @@
 int sdlDevice::getAudioBufferSize()
 {
        // !!!! NOT IMPLEMENTED YET !!!!
-       return 1024;
+       return 4096;
 }
 
 void sdlDevice::setAudioBufferSize( int bufferSize )
@@ -106,7 +106,7 @@
 
 void sdlDevice::fill_audio_do(Sint16 *stream, int len)
 {
-       int framesNum = len / mAudioSpec.channels / 2; // requested data len 
per channel
+       int framesNum = len / mAudioSpec.channels/ 2; // requested data len per 
channel
     
        // call callback if mCallbackRate == 0
        if( mCallback != 0 && mCallbackRate == 0 )

Modified: branches/sound-branch/intern/soundsystem/SND_factory.cpp
===================================================================
--- branches/sound-branch/intern/soundsystem/SND_factory.cpp    2008-07-27 
20:09:57 UTC (rev 15820)
+++ branches/sound-branch/intern/soundsystem/SND_factory.cpp    2008-07-27 
20:17:39 UTC (rev 15821)
@@ -113,8 +113,8 @@
 void SND_RegisterBackends()
 {
        // register readers, writers
-       gSndCfg.mReaders.push_back(new wavReaderFactory());
-       gSndCfg.mReaders.push_back(new aiffReaderFactory());
+       //gSndCfg.mReaders.push_back(new wavReaderFactory());
+       //gSndCfg.mReaders.push_back(new aiffReaderFactory());
 
 #ifdef WITH_FFMPEG
        // init ffmpeg

Modified: 
branches/sound-branch/intern/soundsystem/make/msvc_7_0/soundsystem.vcproj
===================================================================
--- branches/sound-branch/intern/soundsystem/make/msvc_7_0/soundsystem.vcproj   
2008-07-27 20:09:57 UTC (rev 15820)
+++ branches/sound-branch/intern/soundsystem/make/msvc_7_0/soundsystem.vcproj   
2008-07-27 20:17:39 UTC (rev 15821)
@@ -260,30 +260,6 @@
                                RelativePath="..\..\SND_file.cpp">
                        </File>
                        <File
-                               RelativePath="..\..\SND_GameCDObject.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\SND_GameIdObject.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\SND_GameScene.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\SND_GameSoundListener.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\SND_GameSoundObject.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\SND_GameUtils.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\SND_GameWaveCache.cpp">
-                       </File>
-                       <File
-                               RelativePath="..\..\SND_GameWaveSlot.cpp">
-                       </File>
-                       <File
                                RelativePath="..\..\SND_general.cpp">
                        </File>
                        <File
@@ -309,31 +285,59 @@
                                RelativePath="..\..\SND_GameCDObject.h">
                        </File>
                        <File
+                               RelativePath="..\..\SND_internal.h">
+                       </File>
+               </Filter>
+               <Filter
+                       Name="GameEngine"
+                       Filter="">
+                       <File
+                               RelativePath="..\..\SND_GameCDObject.cpp">
+                       </File>
+                       <File
+                               RelativePath="..\..\SND_GameIdObject.cpp">
+                       </File>
+                       <File
                                RelativePath="..\..\SND_GameIdObject.h">
                        </File>
                        <File
                                RelativePath="..\..\SND_GameObject.h">
                        </File>
                        <File
+                               RelativePath="..\..\SND_GameScene.cpp">
+                       </File>
+                       <File
                                RelativePath="..\..\SND_GameScene.h">
                        </File>
                        <File
+                               RelativePath="..\..\SND_GameSoundListener.cpp">
+                       </File>
+                       <File
                                RelativePath="..\..\SND_GameSoundListener.h">
                        </File>
                        <File
+                               RelativePath="..\..\SND_GameSoundObject.cpp">
+                       </File>
+                       <File
                                RelativePath="..\..\SND_GameSoundObject.h">
                        </File>
                        <File
+                               RelativePath="..\..\SND_GameUtils.cpp">
+                       </File>
+                       <File
                                RelativePath="..\..\SND_GameUtils.h">
                        </File>
                        <File
+                               RelativePath="..\..\SND_GameWaveCache.cpp">
+                       </File>
+                       <File
                                RelativePath="..\..\SND_GameWaveCache.h">
                        </File>
                        <File
-                               RelativePath="..\..\SND_GameWaveSlot.h">
+                               RelativePath="..\..\SND_GameWaveSlot.cpp">
                        </File>
                        <File
-                               RelativePath="..\..\SND_internal.h">
+                               RelativePath="..\..\SND_GameWaveSlot.h">
                        </File>
                </Filter>
        </Files>


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to