mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-13 13:07:06 +00:00
merge in newer portaudio
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8835 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
50e9411c82
commit
625c524db7
62 files changed
+23721
-8516
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: pa_asio.cpp 1146 2006-11-23 04:39:43Z rossb $
|
||||
* $Id: pa_asio.cpp 1230 2007-06-15 16:16:33Z rossb $
|
||||
* Portable Audio I/O Library for ASIO Drivers
|
||||
*
|
||||
* Author: Stephane Letz
|
||||
@@ -132,7 +132,7 @@
|
||||
#include "pa_stream.h"
|
||||
#include "pa_cpuload.h"
|
||||
#include "pa_process.h"
|
||||
|
||||
#include "pa_debugprint.h"
|
||||
|
||||
/* This version of pa_asio.cpp is currently only targetted at Win32,
|
||||
It would require a few tweaks to work with pre-OS X Macintosh.
|
||||
@@ -1021,6 +1021,7 @@ static ASIOSampleRate defaultSampleRateSearchOrder_[]
|
||||
/* we look up IsDebuggerPresent at runtime incase it isn't present (on Win95 for example) */
|
||||
typedef BOOL (WINAPI *IsDebuggerPresentPtr)(VOID);
|
||||
IsDebuggerPresentPtr IsDebuggerPresent_ = 0;
|
||||
//FARPROC IsDebuggerPresent_ = 0; // this is the current way to do it apparently according to davidv
|
||||
|
||||
PaError PaAsio_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex )
|
||||
{
|
||||
@@ -1677,6 +1678,7 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||
PaAsioDriverInfo *driverInfo;
|
||||
int *inputChannelSelectors = 0;
|
||||
int *outputChannelSelectors = 0;
|
||||
bool isExternal = false;
|
||||
|
||||
/* unless we move to using lower level ASIO calls, we can only have
|
||||
one device open at a time */
|
||||
@@ -1792,6 +1794,30 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||
}
|
||||
|
||||
|
||||
/* davidv: listing ASIO Clock sources, there is an ongoing investigation by
|
||||
me about whether or not call ASIOSetSampleRate if an external Clock is
|
||||
used. A few drivers expected different things here */
|
||||
{
|
||||
ASIOClockSource clocks[32];
|
||||
long numSources=32;
|
||||
asioError = ASIOGetClockSources(clocks, &numSources);
|
||||
if( asioError != ASE_OK ){
|
||||
PA_DEBUG(("ERROR: ASIOGetClockSources: %s\n", PaAsio_GetAsioErrorText(asioError) ));
|
||||
}else{
|
||||
PA_DEBUG(("INFO ASIOGetClockSources listing %d clocks\n", numSources ));
|
||||
for (int i=0;i<numSources;++i){
|
||||
PA_DEBUG(("ASIOClockSource%d %s current:%d\n", i,clocks[i].name, clocks[i].isCurrentSource ));
|
||||
|
||||
/*
|
||||
If you have problems with some drivers when externally clocked,
|
||||
uncomment the next two lines
|
||||
*/
|
||||
//if (clocks[i].isCurrentSource)
|
||||
// isExternal = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check that the device supports the requested sample rate
|
||||
|
||||
asioError = ASIOCanSampleRate( sampleRate );
|
||||
@@ -1821,7 +1847,8 @@ static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,
|
||||
if (oldRate != sampleRate){
|
||||
|
||||
PA_DEBUG(("before ASIOSetSampleRate(%f)\n",sampleRate));
|
||||
asioError = ASIOSetSampleRate( sampleRate );
|
||||
|
||||
asioError = ASIOSetSampleRate( isExternal?0:sampleRate );
|
||||
/* Set sample rate */
|
||||
if( asioError != ASE_OK )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user