Package: cultivation / 9+dfsg1-2

portaudio19.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Author: Barry deFreese <bdefreese@debian.org>
Description: Patch system to utilize portaudio v19
Bug-Debian: http://bugs.debian.org/594015
Last-Update: 2013-06-01
--- a/game2/gameSource/sound/SoundPlayer.h
+++ b/game2/gameSource/sound/SoundPlayer.h
@@ -239,7 +239,7 @@
         char mFadingIn;
         int mNumFadeFramesRemaining;
         
-        PortAudioStream *mAudioStream;
+        PaStream *mAudioStream;
 
         // realtime sounds that should be mixed into the next to-speaker call
         SimpleVector<PlayableSound *> *mRealtimeSounds;
--- a/game2/gameSource/sound/SoundPlayer.cpp
+++ b/game2/gameSource/sound/SoundPlayer.cpp
@@ -52,9 +52,11 @@
 
 
 // callback passed into portaudio
-static int portaudioCallback( void *inputBuffer, void *outputBuffer,
+int portaudioCallback( const void *inputBuffer, void *outputBuffer,
                               unsigned long framesPerBuffer,
-                              PaTimestamp outTime, void *userData ) {
+                              const PaStreamCallbackTimeInfo *outTime,
+                              PaStreamCallbackFlags statusFlags,
+                              void *userData ) {
 
 
     SoundPlayer *player = (SoundPlayer *)userData;
@@ -157,21 +159,13 @@
 
     if( error == paNoError ) {
     
-        error = Pa_OpenStream(
+        error = Pa_OpenDefaultStream(
             &mAudioStream,
-            paNoDevice,// default input device 
             0,              // no input 
-            paFloat32,  // 32 bit floating point input 
-            NULL,
-            Pa_GetDefaultOutputDeviceID(),
             2,          // stereo output 
             paFloat32,      // 32 bit floating point output 
-            NULL,
             mSampleRate,
             1024,   // frames per buffer
-            0,    // number of buffers, if zero then use default minimum 
-            paClipOff, // we won't output out of range samples so
-                       // don't bother clipping them 
             portaudioCallback,
             (void *)this );  // pass self-pointer to callback function
         
--- a/game2/gameSource/sound/MusicPlayer.cpp
+++ b/game2/gameSource/sound/MusicPlayer.cpp
@@ -112,13 +112,14 @@
 
     // get parts and positions of gardeners
     int numParts = 0;
-    Vector3D **positions =
-        globalWorld->getAllGardenerPositions( &numParts );
-    MusicPart **musicParts =
-        globalWorld->getAllGardenerMusicParts( &numParts );
-    double *volumeModifiers =
-        globalWorld->getAllGardenerMusicVolumeModifiers( &numParts );
-
+    Vector3D **positions = NULL;
+    MusicPart **musicParts = NULL;
+    double *volumeModifiers = NULL;
+    if ( globalWorld ){
+        positions = globalWorld->getAllGardenerPositions( &numParts );
+        musicParts = globalWorld->getAllGardenerMusicParts( &numParts );
+        volumeModifiers = globalWorld->getAllGardenerMusicVolumeModifiers( &numParts );
+    }
     
     // get center position from current player position
     Vector3D *centerPosition = new Vector3D( &globalPlayerCurrentPosition );