-
+# CMakeLists.txt, for utils/iaxclient/lib - 20130925
# even if we don't select the codec, speex is used for pre-processing audio
set(ENABLE_SPEXX 1)
add_definitions(-DHAS_STRING_H -DHAS_STDLIB_H)
add_definitions(-DCODEC_GSM)
+if (MSVC)
+ # turn off various warnings
+ set(WFLAGS)
+ foreach(warning 4244 4305 4996)
+ set(WFLAGS "${WFLAGS} /wd${warning}")
+ endforeach()
+ add_definitions(${WFLAGS})
+endif ()
+
+add_definitions( -DHAVE_CONFIG_H ) # to use fgfs config.h to get FG version, if needed
+add_definitions( -DLIBVER="SVN 261" ) # add an iaxclient_lib version string
+
include_directories(${PROJECT_SOURCE_DIR}/utils/iaxclient/lib)
include_directories(${PROJECT_SOURCE_DIR}/utils/iaxclient/lib/libiax2/src)
include_directories(${PROJECT_SOURCE_DIR}/utils/iaxclient/lib/gsm/inc)
${SPEEX_SOURCES}
${LIBIAX2_SOURCES})
+# eof
int err = alGetError();
d->priv = priv;
- // First we are looking for input device
- priv->in_dev = alcCaptureOpenDevice(NULL, 8000, AL_FORMAT_MONO16, 800);
- if (!priv->in_dev) return openal_error("alcCaptureOpenDevice", alGetError());
-
- alcCaptureStart(priv->in_dev);
- if ((err = alGetError())) return openal_error("alcCaptureStart", err);
-
- // Then we look for output device
+ // First we are looking for output device
priv->out_ctx = alcGetCurrentContext();
if( priv->out_ctx == NULL ) { // FGCom standalone only
alcMakeContextCurrent(priv->out_ctx);
if ((err = alGetError())) return openal_error("alcMakeContextCurrent", err);
+ // Then we look for input device
+ priv->in_dev = alcCaptureOpenDevice(NULL, 8000, AL_FORMAT_MONO16, 800);
+ if (!priv->in_dev) return openal_error("alcCaptureOpenDevice", alGetError());
+ if ((err = alGetError())) return openal_error("alcCaptureOpenDevice1", alGetError());
+
+ alcCaptureStart(priv->in_dev);
+ if ((err = alGetError())) return openal_error("alcCaptureStart", err);
+
priv->sample_rate = sample_rate;
priv->num_buffers = 20;
priv->input_level = 0;
int iax_init(int preferredportno)
{
int portno = preferredportno;
-
+#ifndef _MSC_VER // avoid compare of address of imported function
+ /* MSVC only - In certain circumstances the addresses placed in iax_sendto and iax_recvfrom
+ can be an offset to a jump table, making a compare of the current address to the address
+ of the actual imported function fail. */
if (iax_recvfrom == (iax_recvfrom_t)recvfrom)
+#endif // !_MSC_VER
{
struct sockaddr_in sin;
socklen_t sinlen;