Skip to content
Snippets Groups Projects
Commit 12533fd7 authored by deuce's avatar deuce
Browse files

Work around portaudio 1.8/1.9 incompatabilities regarding PaTimestamp and

PortAudioCallback types.
parent 7e2ff702
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
/* xpdev headers */ /* xpdev headers */
#ifdef WITH_PORTAUDIO #ifdef WITH_PORTAUDIO
#include "portaudio.h" #include <portaudio.h>
#endif #endif
#ifdef WITH_SDL_AUDIO #ifdef WITH_SDL_AUDIO
...@@ -95,9 +95,13 @@ static int portaudio_buf_len=0; ...@@ -95,9 +95,13 @@ static int portaudio_buf_len=0;
static int portaudio_buf_pos=0; static int portaudio_buf_pos=0;
static const unsigned char *pawave; static const unsigned char *pawave;
static int portaudio_initialized=FALSE; static int portaudio_initialized=FALSE;
#ifndef PaStream // Detect version... defined for 1.8 and not for 1.9
#define PortAudioCallback void
#define PaTimestamp PaTime
#endif
struct portaudio_api_struct { struct portaudio_api_struct {
PaError (*init)( void ); PaError (*init)( void );
PaError (*open)( PortAudioStream** stream, PaError (*open)( PaStream** stream,
int numInputChannels, int numInputChannels,
int numOutputChannels, int numOutputChannels,
PaSampleFormat sampleFormat, PaSampleFormat sampleFormat,
...@@ -106,11 +110,11 @@ struct portaudio_api_struct { ...@@ -106,11 +110,11 @@ struct portaudio_api_struct {
unsigned long numberOfBuffers, unsigned long numberOfBuffers,
PortAudioCallback *callback, PortAudioCallback *callback,
void *userData ); void *userData );
PaError (*close)( PortAudioStream* ); PaError (*close)( PaStream* );
PaError (*start)( PortAudioStream *stream ); PaError (*start)( PaStream *stream );
PaError (*stop)( PortAudioStream *stream ); PaError (*stop)( PaStream *stream );
PaError (*active)( PortAudioStream *stream ); PaError (*active)( PaStream *stream );
PaError (*write)( PortAudioStream *stream, const void *buf, unsigned long frames ); PaError (*write)( PaStream *stream, const void *buf, unsigned long frames );
int (*version)( void ); int (*version)( void );
int ver; int ver;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment