From: Derek J S. <der...@us...> - 2006-02-24 23:13:50
|
Update of /cvsroot/openh323/contrib/openmcu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15879 Modified Files: audio.cxx conference.h Log Message: Remove compile warnings on a 64 bit machine. Use pwlib's PAdaptiveDelay structure for calculating delays. On linux, it was skipping 40ms every 1.7 seconds or so (a 1024==>1000 rounding error). Index: conference.h =================================================================== RCS file: /cvsroot/openh323/contrib/openmcu/conference.h,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** conference.h 8 Feb 2006 06:54:44 -0000 2.6 --- conference.h 24 Feb 2006 23:13:44 -0000 2.7 *************** *** 31,34 **** --- 31,39 ---- * * $Log$ + * Revision 2.7 2006/02/24 23:13:44 dereksmithies + * Remove compile warnings on a 64 bit machine. + * Use pwlib's PAdaptiveDelay structure for calculating delays. On linux, it was skipping + * 40ms every 1.7 seconds or so (a 1024==>1000 rounding error). + * * Revision 2.6 2006/02/08 06:54:44 csoutheren * Added extra information to monitoring page *************** *** 77,82 **** class OpenMCUH323Connection; #define NO_MCU_VIDEO ! //////////////////////////////////////////////////// --- 82,89 ---- class OpenMCUH323Connection; + #ifndef NO_MCU_VIDEO #define NO_MCU_VIDEO ! #endif ! #include <ptclib/delaychan.h> //////////////////////////////////////////////////// *************** *** 122,128 **** protected: ! PTime previousTime; ! BOOL firstTime; ! int error; }; --- 129,134 ---- protected: ! ! PAdaptiveDelay myDelay; }; *************** *** 175,179 **** #endif virtual PString GetName() const ! { return PString(PString::Unsigned, (unsigned)id); } #ifdef _WIN32 #pragma warning(pop) --- 181,185 ---- #endif virtual PString GetName() const ! { return PString(PString::Unsigned, (long unsigned)id); } #ifdef _WIN32 #pragma warning(pop) *************** *** 263,267 **** */ virtual PString GetTitle() const ! { return PString(PString::Unsigned, (unsigned)id); } #ifdef _WIN32 --- 269,273 ---- */ virtual PString GetTitle() const ! { return PString(PString::Unsigned, (long unsigned)id); } #ifdef _WIN32 Index: audio.cxx =================================================================== RCS file: /cvsroot/openh323/contrib/openmcu/audio.cxx,v retrieving revision 2.0 retrieving revision 2.1 diff -C2 -d -r2.0 -r2.1 *** audio.cxx 8 Mar 2004 02:06:24 -0000 2.0 --- audio.cxx 24 Feb 2006 23:13:44 -0000 2.1 *************** *** 31,34 **** --- 31,39 ---- * * $Log$ + * Revision 2.1 2006/02/24 23:13:44 dereksmithies + * Remove compile warnings on a 64 bit machine. + * Use pwlib's PAdaptiveDelay structure for calculating delays. On linux, it was skipping + * 40ms every 1.7 seconds or so (a 1024==>1000 rounding error). + * * Revision 2.0 2004/03/08 02:06:24 csoutheren * Totally rewritten to use new connection locking mecahnism *************** *** 47,86 **** AudioDelay::AudioDelay() { ! firstTime = TRUE; ! error = 0; } void AudioDelay::Restart() { - firstTime = TRUE; } BOOL AudioDelay::Delay(int frameTime) { ! if (firstTime) { ! firstTime = FALSE; ! previousTime = PTime(); ! return TRUE; ! } ! ! // add in the new delay ! error += frameTime; ! ! // remove the actual delay since the last call ! PTime now; ! PTimeInterval delay = now - previousTime; ! error -= (int)delay.GetMilliSeconds(); ! previousTime = now; ! ! // if the delay is > 10 ms, then accumulate the error until next time ! if (error > 10) { ! #ifdef P_LINUX ! usleep(error * 1000); ! #else ! PThread::Current()->Sleep(error); ! #endif ! } ! ! //return error <= -frameTime; ! return FALSE; } --- 52,65 ---- AudioDelay::AudioDelay() { ! } void AudioDelay::Restart() { } BOOL AudioDelay::Delay(int frameTime) { ! myDelay.Delay(frameTime); ! return FALSE; } |