Commit 92847f56 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Move time spec definition from ms2 to oRTP.

parent 0e62557b
......@@ -254,8 +254,6 @@ PKG_PROG_PKG_CONFIG()
AC_SUBST(MSPLUGINS_CFLAGS)
AC_SUBST(MSPLUGINS_LIBS)
AC_CHECK_LIB(rt,clock_gettime,[LIBS="$LIBS -lrt"])
dnl *********************************
dnl various checks for soundcard apis
dnl *********************************
......
......@@ -96,10 +96,9 @@ static inline void ms_debug(const char *fmt,...)
#define ms_thread_create ortp_thread_create
#define ms_thread_join ortp_thread_join
typedef struct MSTimeSpec{
int64_t tv_sec;
int64_t tv_nsec;
}MSTimeSpec;
typedef ortpTimeSpec MSTimeSpec;
#define ms_get_cur_time ortp_get_cur_time
struct _MSList {
struct _MSList *next;
......@@ -120,7 +119,6 @@ extern "C"{
#endif
void ms_thread_exit(void* ret_val);
MS2_PUBLIC void ms_get_cur_time(MSTimeSpec *ret);
MS2_PUBLIC MSList * ms_list_append(MSList *elem, void * data);
MS2_PUBLIC MSList * ms_list_prepend(MSList *elem, void * data);
MS2_PUBLIC MSList * ms_list_free(MSList *elem);
......
......@@ -741,42 +741,6 @@ void ms_thread_exit(void* ref_val) {
}
#ifdef __MACH__
#include <sys/types.h>
#include <sys/timeb.h>
#endif
void ms_get_cur_time(MSTimeSpec *ret){
#if defined(_WIN32_WCE) || defined(WIN32)
DWORD timemillis;
# if defined(_WIN32_WCE)
timemillis=GetTickCount();
# else
timemillis=timeGetTime();
# endif
ret->tv_sec=timemillis/1000;
ret->tv_nsec=(timemillis%1000)*1000000LL;
#elif defined(__MACH__) && defined(__GNUC__) && (__GNUC__ >= 3)
struct timeval tv;
gettimeofday(&tv, NULL);
ret->tv_sec=tv.tv_sec;
ret->tv_nsec=tv.tv_usec*1000LL;
#elif defined(__MACH__)
struct timeb time_val;
ftime (&time_val);
ret->tv_sec = time_val.time;
ret->tv_nsec = time_val.millitm * 1000000LL;
#else
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC,&ts)<0){
ms_fatal("clock_gettime() doesn't work: %s",strerror(errno));
}
ret->tv_sec=ts.tv_sec;
ret->tv_nsec=ts.tv_nsec;
#endif
}
struct _MSConcealerContext {
int64_t sample_time;
int64_t plc_start_time;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment