|
From: <do...@us...> - 2008-01-30 19:02:57
|
Revision: 1337
http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1337&view=rev
Author: dohpaz
Date: 2008-01-30 11:02:59 -0800 (Wed, 30 Jan 2008)
Log Message:
-----------
Merge up to trunk of r1336.
Modified Paths:
--------------
branches/team/elbunce/iaxclient/configure.ac
branches/team/elbunce/iaxclient/contrib/win/vc6/libiax2.dsp
branches/team/elbunce/iaxclient/contrib/win/vs2005/libiax2.vcproj
branches/team/elbunce/iaxclient/contrib/win/vs2005/libiaxclient.vcproj
branches/team/elbunce/iaxclient/lib/audio_encode.c
branches/team/elbunce/iaxclient/lib/audio_portaudio.c
branches/team/elbunce/iaxclient/lib/iaxclient_lib.c
branches/team/elbunce/iaxclient/lib/iaxclient_lib.h
branches/team/elbunce/iaxclient/lib/libiax2/configure.in
branches/team/elbunce/iaxclient/lib/libiax2/src/iax-client.h
branches/team/elbunce/iaxclient/lib/libiax2/src/iax.c
branches/team/elbunce/iaxclient/lib/video.c
branches/team/elbunce/iaxclient/lib/winfuncs.c
Removed Paths:
-------------
branches/team/elbunce/iaxclient/lib/libiax2/src/winpoop.h
Modified: branches/team/elbunce/iaxclient/configure.ac
===================================================================
--- branches/team/elbunce/iaxclient/configure.ac 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/configure.ac 2008-01-30 19:02:59 UTC (rev 1337)
@@ -47,6 +47,7 @@
AC_CHECK_FUNCS([vsnprintf _vsnprintf])
AC_CHECK_FUNCS([srandomdev srandom srand48 random lrand48])
+AC_CHECK_FUNCS(gettimeofday)
ACX_PTHREAD
Modified: branches/team/elbunce/iaxclient/contrib/win/vc6/libiax2.dsp
===================================================================
--- branches/team/elbunce/iaxclient/contrib/win/vc6/libiax2.dsp 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/contrib/win/vc6/libiax2.dsp 2008-01-30 19:02:59 UTC (rev 1337)
@@ -159,10 +159,6 @@
SOURCE=..\..\..\lib\libiax2\src\ringtone.h
# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\lib\libiax2\src\winpoop.h
-# End Source File
# End Group
# End Target
# End Project
Modified: branches/team/elbunce/iaxclient/contrib/win/vs2005/libiax2.vcproj
===================================================================
--- branches/team/elbunce/iaxclient/contrib/win/vs2005/libiax2.vcproj 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/contrib/win/vs2005/libiax2.vcproj 2008-01-30 19:02:59 UTC (rev 1337)
@@ -222,10 +222,6 @@
RelativePath="..\..\..\lib\libiax2\src\ringtone.h"
>
</File>
- <File
- RelativePath="..\..\..\lib\libiax2\src\winpoop.h"
- >
- </File>
</Filter>
<Filter
Name="Resource Files"
Modified: branches/team/elbunce/iaxclient/contrib/win/vs2005/libiaxclient.vcproj
===================================================================
--- branches/team/elbunce/iaxclient/contrib/win/vs2005/libiaxclient.vcproj 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/contrib/win/vs2005/libiaxclient.vcproj 2008-01-30 19:02:59 UTC (rev 1337)
@@ -40,7 +40,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common;..\..\..\..\libvidcap\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;SPEEX_EC=1;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA;CODEC_GSM"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA;CODEC_GSM"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
@@ -104,7 +104,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common;..\..\..\..\libvidcap\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;SPEEX_EC=1;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA;CODEC_GSM"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA;CODEC_GSM"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
@@ -167,7 +167,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common;..\..\..\..\libvidcap\include"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;SPEEX_EC=1;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA;CODEC_GSM"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA;CODEC_GSM"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
@@ -239,7 +239,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\lib\libiax2\src;..\..\..\..\portaudio\include;..\..\..\lib\spandsp;..\..\..\lib\gsm\inc;..\..\..\..\speex\include;..\..\..\..\libogg\include;..\..\..\..\libtheora\include;..\..\..\lib\portmixer\px_common;..\..\..\..\libvidcap\include"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;SPEEX_EC=1;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA;CODEC_GSM"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PA_NO_DS;PA_NO_ASIO;BUILDING_DLL;LIBIAX;_CRT_SECURE_NO_DEPRECATE;strncasecmp=strnicmp;__inline__=_inline;NTDDI_VERSION=NTDDI_WIN2KSP4;_WIN32_WINNT=0x0500;WINVER=0x0500;USE_VIDEO;USE_THEORA;CODEC_GSM"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Modified: branches/team/elbunce/iaxclient/lib/audio_encode.c
===================================================================
--- branches/team/elbunce/iaxclient/lib/audio_encode.c 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/audio_encode.c 2008-01-30 19:02:59 UTC (rev 1337)
@@ -71,7 +71,7 @@
float input_db;
float output_db;
- gettimeofday(&now, 0);
+ now = iax_tvnow();
if ( last.tv_sec != 0 && iaxci_usecdiff(&now, &last) < 100000 )
return 0;
@@ -261,7 +261,7 @@
int insize = samples;
/* update last input timestamp */
- gettimeofday( &timeLastInput, NULL ) ;
+ timeLastInput = iax_tvnow();
silent = input_postprocess(data, insize, 8000);
@@ -342,7 +342,7 @@
int insize = len;
int outsize = *samples;
- gettimeofday( &timeLastOutput, NULL ) ;
+ timeLastOutput = iax_tvnow();
if ( format == 0 )
{
Modified: branches/team/elbunce/iaxclient/lib/audio_portaudio.c
===================================================================
--- branches/team/elbunce/iaxclient/lib/audio_portaudio.c 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/audio_portaudio.c 2008-01-30 19:02:59 UTC (rev 1337)
@@ -38,16 +38,19 @@
#include "portmixer.h"
#ifdef USE_MEC2
+#define DO_EC
#include "mec3.h"
static echo_can_state_t *ec;
#endif
#ifdef SPAN_EC
+#define DO_EC
#include "ec/echo.h"
static echo_can_state_t *ec;
#endif
-#ifdef SPEEX_EC
+#if defined(SPEEX_EC) && ! defined (WIN32)
+#define DO_EC
#define restrict __restrict
#include "speex/speex_echo.h"
static SpeexEchoState *ec;
@@ -427,33 +430,35 @@
* it's turned back on. */
if ( !(iaxc_get_filters() & IAXC_FILTER_ECHO) )
{
+#if defined(DO_EC)
if ( ec )
{
#if defined(USE_MEC2) || defined(SPAN_EC)
echo_can_free(ec);
ec = NULL;
-#endif
-#if defined(SPEEX_EC)
+#elif defined(SPEEX_EC)
speex_echo_state_destroy(ec);
ec = NULL;
#endif
}
+#endif
return;
}
/* we want echo cancellation */
+#if defined(DO_EC)
if ( !ec )
{
rb_InitializeRingBuffer(&ecOutRing, EC_RING_SZ, &outRingBuf);
#if defined(USE_MEC2) || defined(SPAN_EC)
ec = echo_can_create(ECHO_TAIL, 0);
-#endif
-#if defined(SPEEX_EC)
+#elif defined(SPEEX_EC)
ec = speex_echo_state_init(SAMPLES_PER_FRAME, ECHO_TAIL);
#endif
}
+#endif
/* fill ecOutRing */
rb_WriteRingBuffer(&ecOutRing, outputBuffer, n * 2);
@@ -465,7 +470,7 @@
rb_ReadRingBuffer(&ecOutRing, delayedBuf, n * 2);
-#if defined(SPEEX_EC)
+#if defined(DO_EC) && defined(SPEEX_EC)
{
short cancelledBuffer[1024];
Modified: branches/team/elbunce/iaxclient/lib/iaxclient_lib.c
===================================================================
--- branches/team/elbunce/iaxclient/lib/iaxclient_lib.c 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/iaxclient_lib.c 2008-01-30 19:02:59 UTC (rev 1337)
@@ -742,7 +742,7 @@
{
if ( callNo < 0 )
return;
- gettimeofday(&calls[callNo].last_activity, NULL);
+ calls[callNo].last_activity = iax_tvnow();
}
static void iaxc_refresh_registrations()
@@ -750,7 +750,7 @@
struct iaxc_registration *cur;
struct timeval now;
- gettimeofday(&now,NULL);
+ now = iax_tvnow();
for ( cur = registrations; cur != NULL; cur = cur->next )
{
@@ -1273,7 +1273,7 @@
return -1;
}
- gettimeofday(&newreg->last,NULL);
+ newreg->last = iax_tvnow();
newreg->refresh = refresh;
strncpy(newreg->host, host, 256);
Modified: branches/team/elbunce/iaxclient/lib/iaxclient_lib.h
===================================================================
--- branches/team/elbunce/iaxclient/lib/iaxclient_lib.h 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/iaxclient_lib.h 2008-01-30 19:02:59 UTC (rev 1337)
@@ -32,7 +32,6 @@
#include <string.h>
#if defined(WIN32) || defined(_WIN32_WCE)
-void gettimeofday(struct timeval *tv, void /*struct timezone*/ *tz);
#include <winsock.h>
#if !defined(_WIN32_WCE)
#include <process.h>
Modified: branches/team/elbunce/iaxclient/lib/libiax2/configure.in
===================================================================
--- branches/team/elbunce/iaxclient/lib/libiax2/configure.in 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/libiax2/configure.in 2008-01-30 19:02:59 UTC (rev 1337)
@@ -15,6 +15,8 @@
dnl Check header files
AC_HEADER_STDC
+AC_CHECK_FUNCS(gettimeofday)
+
AC_SUBST(LIBS)
AC_ARG_ENABLE(snomhack, [ --enable-snomhack Use slower memset for SNOM phoneem ],,enable_snomhack=no)
Modified: branches/team/elbunce/iaxclient/lib/libiax2/src/iax-client.h
===================================================================
--- branches/team/elbunce/iaxclient/lib/libiax2/src/iax-client.h 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/libiax2/src/iax-client.h 2008-01-30 19:02:59 UTC (rev 1337)
@@ -200,6 +200,8 @@
extern void iax_enable_debug(void);
extern void iax_disable_debug(void);
+extern struct timeval iax_tvnow(void);
+
/* For attended transfer, application create a new session,
* make a call on the new session.
* On answer of the new session, call iax_setup_transfer and wait for
Modified: branches/team/elbunce/iaxclient/lib/libiax2/src/iax.c
===================================================================
--- branches/team/elbunce/iaxclient/lib/libiax2/src/iax.c 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/libiax2/src/iax.c 2008-01-30 19:02:59 UTC (rev 1337)
@@ -34,6 +34,9 @@
#include <stdio.h>
#include <limits.h>
+#if !defined(_WIN32_WCE)
+#include <sys/timeb.h>
+#endif
#define snprintf _snprintf
@@ -44,14 +47,6 @@
#endif
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-void gettimeofday(struct timeval *tv, void /*struct timezone*/ *tz);
-#ifdef __cplusplus
-}
-#endif
-
#else
#include <netdb.h>
@@ -278,30 +273,6 @@
s->sendto = ptr;
}
-void iax_seed_random()
-{
-#if defined(HAVE_SRANDOMDEV)
- srandomdev();
-#elif defined(HAVE_SRANDOM)
- srandom((unsigned int)time(0));
-#elif defined(HAVE_SRAND48)
- srand48((long int)time(0));
-#else
- srand((unsigned int)time(0));
-#endif
-}
-
-int iax_random()
-{
-#if defined(HAVE_RANDOM)
- return (int)random();
-#elif defined(HAVE_LRAND48)
- return (int)lrand48();
-#else
- return rand();
-#endif
-}
-
/* This is a little strange, but to debug you call DEBU(G "Hello World!\n"); */
#if defined(WIN32) || defined(_WIN32_WCE)
#define G __FILE__, __LINE__,
@@ -346,6 +317,30 @@
#define G
#endif
+void iax_seed_random()
+{
+#if defined(HAVE_SRANDOMDEV)
+ srandomdev();
+#elif defined(HAVE_SRANDOM)
+ srandom((unsigned int)time(0));
+#elif defined(HAVE_SRAND48)
+ srand48((long int)time(0));
+#else
+ srand((unsigned int)time(0));
+#endif
+}
+
+int iax_random()
+{
+#if defined(HAVE_RANDOM)
+ return (int)random();
+#elif defined(HAVE_LRAND48)
+ return (int)lrand48();
+#else
+ return rand();
+#endif
+}
+
typedef void (*sched_func)(void *);
struct iax_sched {
@@ -393,7 +388,7 @@
sched = (struct iax_sched*)malloc(sizeof(struct iax_sched));
if (sched) {
memset(sched, 0, sizeof(struct iax_sched));
- gettimeofday(&sched->when, NULL);
+ sched->when = iax_tvnow();
sched->when.tv_sec += (ms / 1000);
ms = ms % 1000;
sched->when.tv_usec += (ms * 1000);
@@ -460,7 +455,7 @@
/* If there are no pending events, we don't need to timeout */
if (!cur)
return -1;
- gettimeofday(&tv, NULL);
+ tv = iax_tvnow();
while(cur) {
ms = (cur->when.tv_sec - tv.tv_sec) * 1000 +
(cur->when.tv_usec - tv.tv_usec) / 1000;
@@ -595,7 +590,7 @@
/* If this is the first packet we're sending, get our
offset now. */
if (!session->offset.tv_sec && !session->offset.tv_usec)
- gettimeofday(&session->offset, NULL);
+ session->offset = iax_tvnow();
/* If the timestamp is specified, just use their specified
timestamp no matter what. Usually this is done for
@@ -608,7 +603,7 @@
}
/* Otherwise calculate the timestamp from the current time */
- gettimeofday(&tv, NULL);
+ tv = iax_tvnow();
/* Calculate the number of milliseconds since we sent the first packet */
ms = (tv.tv_sec - session->offset.tv_sec) * 1000 +
@@ -1418,12 +1413,12 @@
struct iax_session *s0 = org_session;
struct iax_session *s1 = new_session;
+ int transfer_id = 1 + (int)(32767.0 * (iax_random() / (RAND_MAX + 1.0)));
+
memset(&ied0, 0, sizeof(ied0));
memset(&ied1, 0, sizeof(ied1));
- int transfer_id = 1 + (int)(32767.0 * (iax_random() / (RAND_MAX + 1.0)));
-
/* reversed setup */
iax_ie_append_addr(&ied0, IAX_IE_APPARENT_ADDR, &s1->peeraddr);
iax_ie_append_short(&ied0, IAX_IE_CALLNO, s1->peercallno);
@@ -2230,9 +2225,9 @@
int ms;
if (!session->rxcore.tv_sec && !session->rxcore.tv_usec) {
- gettimeofday(&session->rxcore, NULL);
+ session->rxcore = iax_tvnow();
}
- gettimeofday(&tv, NULL);
+ tv = iax_tvnow();
ms = (tv.tv_sec - session->rxcore.tv_sec) * 1000 +
(tv.tv_usec - session->rxcore.tv_usec) / 1000;
@@ -3266,7 +3261,7 @@
struct iax_sched *cur;
struct iax_session *session;
- gettimeofday(&tv, NULL);
+ tv = iax_tvnow();
while((cur = iax_get_sched(tv)))
{
@@ -3492,3 +3487,21 @@
return send_command(session, AST_FRAME_IAX, IAX_COMMAND_QUELCH, 0, ied.buf, ied.pos, -1);
}
+
+struct timeval iax_tvnow(void)
+{
+ struct timeval tv;
+
+#ifdef HAVE_GETTIMEOFDAY
+ gettimeofday(&tv, 0);
+#elif defined(_MSC_VER)
+ struct _timeb curSysTime;
+
+ _ftime(&curSysTime);
+ tv.tv_sec = (long)curSysTime.time;
+ tv.tv_usec = curSysTime.millitm * 1000;
+#else
+#error no gettimeofday or equivalent available
+#endif
+ return tv;
+}
Deleted: branches/team/elbunce/iaxclient/lib/libiax2/src/winpoop.h
===================================================================
--- branches/team/elbunce/iaxclient/lib/libiax2/src/winpoop.h 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/libiax2/src/winpoop.h 2008-01-30 19:02:59 UTC (rev 1337)
@@ -1,41 +0,0 @@
-/*
- * Functions Windows doesn't have... but should
- * Copyright(C) 2001, Linux Support Services, Inc.
- *
- * Distributed under GNU LGPL.
- *
- * These are NOT fully compliant with BSD 4.3 and are not
- * threadsafe.
- *
- */
-
-#ifndef _winpoop_h
-#define _winpoop_h
-
-#if defined(_MSC_VER)
-#define INLINE __inline
-#else
-#define INLINE inline
-#endif
-
-#include <winsock.h>
-
-void gettimeofday(struct timeval *tv, void /*struct timezone*/ *tz);
-
-static INLINE int inet_aton(char *cp, struct in_addr *inp)
-{
- int a1, a2, a3, a4;
- unsigned int saddr;
-
- if (sscanf(cp, "%d.%d.%d.%d", &a1, &a2, &a3, &a4) != 4)
- return 0;
- a1 &= 0xff;
- a2 &= 0xff;
- a3 &= 0xff;
- a4 &= 0xff;
- saddr = (a1 << 24) | (a2 << 16) | (a3 << 8) | a4;
- inp->s_addr = htonl(saddr);
- return 1;
-}
-
-#endif
Modified: branches/team/elbunce/iaxclient/lib/video.c
===================================================================
--- branches/team/elbunce/iaxclient/lib/video.c 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/video.c 2008-01-30 19:02:59 UTC (rev 1337)
@@ -139,7 +139,7 @@
return;
memset(&vcodec->video_stats, 0, sizeof(struct iaxc_video_stats));
- gettimeofday(&vcodec->video_stats.start_time, 0);
+ vcodec->video_stats.start_time = iax_tvnow();
}
static void reset_video_stats(struct iaxc_call * call)
@@ -200,9 +200,9 @@
return -1;
if ( video_stats_start.tv_sec == 0 && video_stats_start.tv_usec == 0 )
- gettimeofday(&video_stats_start, 0);
+ video_stats_start = iax_tvnow();
- gettimeofday(&now, 0);
+ now = iax_tvnow();
if ( iaxci_msecdiff(&now, &video_stats_start) > video_stats_interval )
{
@@ -732,7 +732,7 @@
/* Gather statistics */
call->vencoder->video_stats.outbound_frames++;
- gettimeofday(&now, 0);
+ now = iax_tvnow();
time_delta =
iaxci_msecdiff(&now, &call->vencoder->video_stats.start_time);
@@ -1298,7 +1298,7 @@
}
/* Statistics */
- gettimeofday(&now, 0);
+ now = iax_tvnow();
time = iaxci_msecdiff(&now, &call->vdecoder->video_stats.start_time);
call->vdecoder->video_stats.received_slices++;
call->vdecoder->video_stats.acc_recv_size += encoded_video_len;
@@ -1778,9 +1778,9 @@
return -1;
if ( video_stats_start.tv_sec == 0 && video_stats_start.tv_usec == 0 )
- gettimeofday(&video_stats_start, 0);
+ video_stats_start = iax_tvnow();
- gettimeofday(&now, 0);
+ now = iax_tvnow();
if ( iaxci_msecdiff(&now, &video_stats_start) > video_stats_interval )
{
Modified: branches/team/elbunce/iaxclient/lib/winfuncs.c
===================================================================
--- branches/team/elbunce/iaxclient/lib/winfuncs.c 2008-01-30 16:18:05 UTC (rev 1336)
+++ branches/team/elbunce/iaxclient/lib/winfuncs.c 2008-01-30 19:02:59 UTC (rev 1337)
@@ -19,33 +19,6 @@
#include <stdio.h>
-#if !defined(_WIN32_WCE)
-#include <sys/timeb.h>
-
-/* Win-doze doesnt have gettimeofday(). This sux. So, what we did is
-provide some gettimeofday-like functionality that works for our purposes. */
-
-/*
- changed 'struct timezone*' to 'void*' since
- timezone is defined as a long in MINGW and caused compile-time warnings.
- this should be okay since we don't use the passed value.
-*/
-
-
-/*
- * functions implementations
- */
-
-void gettimeofday( struct timeval* tv, void* tz )
-{
- struct _timeb curSysTime;
-
- _ftime(&curSysTime);
- tv->tv_sec = (long)curSysTime.time;
- tv->tv_usec = curSysTime.millitm * 1000;
-}
-#endif
-
void os_init(void)
{
WSADATA wsd;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|