Commit 3425b2e6 authored by Sam Hocevar's avatar Sam Hocevar

* ./src/misc/mtime.c: we use nanosleep whenever possible (patch from Meuuh).

parent 815d5642
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -111,7 +111,7 @@ dnl The -DSYS_FOO flag
save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
AC_CHECK_FUNC(connect,,[
AC_CHECK_LIB(socket,connect,
......@@ -124,10 +124,12 @@ AC_CHECK_FUNC(gethostbyname,,[
AC_CHECK_FUNC(gethostbyname,,[
AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
])
AC_CHECK_FUNC(nanosleep,,[
AC_CHECK_LIB(rt,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lrt",[
AC_CHECK_LIB(posix4,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4")
])
AC_CHECK_FUNCS(nanosleep,,[
AC_CHECK_LIB(rt,nanosleep,
[vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"],
[AC_CHECK_LIB(posix4,nanosleep,
[vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"])]
)
])
AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
......@@ -193,6 +195,14 @@ AC_CHECK_HEADERS(linux/version.h)
AC_HEADER_TIME
dnl Mac OS X and other OSes don't have declaration for nanosleep
dnl This only works with autoconf 2.52
AC_CHECK_DECLS(nanosleep)
dnl Make sure we have timespecs
dnl This only works with autoconf 2.52
AC_CHECK_TYPES(struct timespec)
dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
......
......@@ -41,7 +41,7 @@
/* When creating or destroying threads in blocking mode, delay to poll thread
* status */
#define THREAD_SLEEP ((int)(0.010*CLOCK_FREQ))
#define THREAD_SLEEP ((mtime_t)(0.010*CLOCK_FREQ))
/* When a thread waits on a condition in debug mode, delay to wait before
* outputting an error message (in second) */
......@@ -62,7 +62,7 @@
*****************************************************************************/
/* Base delay in micro second for interface sleeps */
#define INTF_IDLE_SLEEP ((int)(0.050*CLOCK_FREQ))
#define INTF_IDLE_SLEEP ((mtime_t)(0.050*CLOCK_FREQ))
/* Step for changing gamma, and minimum and maximum values */
#define INTF_GAMMA_STEP .1
......@@ -73,7 +73,7 @@
*****************************************************************************/
/* XXX?? */
#define INPUT_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
#define INPUT_IDLE_SLEEP ((mtime_t)(0.100*CLOCK_FREQ))
/*
* General limitations
......@@ -204,13 +204,13 @@
#define VOUT_FPS_SAMPLES 20
/* Better be in advance when awakening than late... */
#define VOUT_MWAIT_TOLERANCE ((int)(0.020*CLOCK_FREQ))
#define VOUT_MWAIT_TOLERANCE ((mtime_t)(0.020*CLOCK_FREQ))
/* Time to sleep when waiting for a buffer (from vout or the video fifo).
* It should be approximately the time needed to perform a complete picture
* loop. Since it only happens when the video heap is full, it does not need
* to be too low, even if it blocks the decoder. */
#define VOUT_OUTMEM_SLEEP ((int)(0.020*CLOCK_FREQ))
#define VOUT_OUTMEM_SLEEP ((mtime_t)(0.020*CLOCK_FREQ))
/* The default video output window title */
#define VOUT_TITLE "VideoLAN Client " VERSION
......@@ -219,7 +219,7 @@
* Video parser configuration
*****************************************************************************/
#define VPAR_IDLE_SLEEP ((int)(0.010*CLOCK_FREQ))
#define VPAR_IDLE_SLEEP ((mtime_t)(0.010*CLOCK_FREQ))
/* Optimization level, from 0 to 2 - 1 is generally a good compromise. Remember
* that raising this level dramatically lengthens the compilation time. */
......@@ -236,7 +236,7 @@
* Video decoder configuration
*****************************************************************************/
#define VDEC_IDLE_SLEEP ((int)(0.100*CLOCK_FREQ))
#define VDEC_IDLE_SLEEP ((mtime_t)(0.100*CLOCK_FREQ))
/* Maximum range of values out of the IDCT + motion compensation. */
#define VDEC_CROPRANGE 2048
......
/* include/defs.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* include/defs.h.in. Generated from configure.in by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Maximum supported data alignment */
#undef ATTRIBUTE_ALIGNED_MAX
/* Define to empty if the keyword does not work. */
#undef const
/* Define if <cthreads.h> defines boolean_t. */
#undef BOOLEAN_T_IN_CTHREADS_H
/* Define if <pthread.h> defines boolean_t. */
#undef BOOLEAN_T_IN_PTHREAD_H
/* Define if <sys/types.h> defines boolean_t. */
#undef BOOLEAN_T_IN_SYS_TYPES_H
/* Define if $CC groks 3D Now! inline assembly. */
#undef CAN_COMPILE_3DNOW
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
/* Define if $CC groks ALTIVEC inline assembly. */
#undef CAN_COMPILE_ALTIVEC
/* Define if your compiler groks C altivec extensions. */
#undef CAN_COMPILE_C_ALTIVEC
/* Define if $CC groks SSE inline assembly. */
#undef CAN_COMPILE_SSE
/* Copyright string */
#undef COPYRIGHT_MESSAGE
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
#undef CRAY_STACKSEG_END
/* Define if you have alloca, as a function or macro. */
/* Define to 1 if using `alloca.c'. */
#undef C_ALLOCA
/* Define if <X11/extensions/dpms.h> defines DPMSInfo. */
#undef DPMSINFO_IN_DPMS_H
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
/* Define to 1 if you have the <a52dec/a52.h> header file. */
#undef HAVE_A52DEC_A52_H
/* Define to 1 if you have `alloca', as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#undef HAVE_ALLOCA_H
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to 1 if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define to 1 if you have the <Cocoa/Cocoa.h> header file. */
#undef HAVE_COCOA_COCOA_H
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define to 1 if you have the <cthreads.h> header file. */
#undef HAVE_CTHREADS_H
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define to 1 if you have the `dcgettext' function. */
#undef HAVE_DCGETTEXT
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you have the <ddraw.h> header file. */
#undef HAVE_DDRAW_H
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define to 1 if you have the declaration of `nanosleep', and to 0 if you
don't. */
#undef HAVE_DECL_NANOSLEEP
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define if you have the __argz_next function. */
#undef HAVE___ARGZ_NEXT
/* Define to 1 if you have the <dvdcss/dvdcss.h> header file. */
#undef HAVE_DVDCSS_DVDCSS_H
/* Define if you have the __argz_stringify function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define to 1 if you have the <dvdread/dvd_reader.h> header file. */
#undef HAVE_DVDREAD_DVD_READER_H
/* Define if you have the dcgettext function. */
#undef HAVE_DCGETTEXT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define if you have the feof_unlocked function. */
/* Define to 1 if you have the `feof_unlocked' function. */
#undef HAVE_FEOF_UNLOCKED
/* Define if you have the fgets_unlocked function. */
/* Define to 1 if you have the `fgets_unlocked' function. */
#undef HAVE_FGETS_UNLOCKED
/* Define if you have the getcwd function. */
/* Define to 1 if you have the <gdk/gdk.h> header file. */
#undef HAVE_GDK_GDK_H
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
/* Define if you have the getegid function. */
/* Define to 1 if you have the `getegid' function. */
#undef HAVE_GETEGID
/* Define if you have the geteuid function. */
/* Define to 1 if you have the `geteuid' function. */
#undef HAVE_GETEUID
/* Define if you have the getgid function. */
/* Define to 1 if you have the `getgid' function. */
#undef HAVE_GETGID
/* Define if you have the gethostbyname2 function. */
/* Define to 1 if you have the `gethostbyname2' function. */
#undef HAVE_GETHOSTBYNAME2
/* Define if you have the getpagesize function. */
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* getopt support */
#undef HAVE_GETOPT_LONG
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the getpwuid function. */
/* Define to 1 if you have the `getpwuid' function. */
#undef HAVE_GETPWUID
/* Define if you have the gettimeofday function. */
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the getuid function. */
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define if you have the isatty function. */
#undef HAVE_ISATTY
/* Define if you have the memalign function. */
#undef HAVE_MEMALIGN
/* Define if you have the mempcpy function. */
#undef HAVE_MEMPCPY
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
/* Define if you have the posix_memalign function. */
#undef HAVE_POSIX_MEMALIGN
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
/* Define if you have the select function. */
#undef HAVE_SELECT
/* Define to 1 if you have the <glib.h> header file. */
#undef HAVE_GLIB_H
/* Define if you have the setenv function. */
#undef HAVE_SETENV
/* Define to 1 if you have the <gnome.h> header file. */
#undef HAVE_GNOME_H
/* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE
/* Define to 1 if you have the <gtk/gtk.h> header file. */
#undef HAVE_GTK_GTK_H
/* Define if you have the sigrelse function. */
#undef HAVE_SIGRELSE
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define to 1 if you have the <image.h> header file. */
#undef HAVE_IMAGE_H
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
/* For FreeBSD VCD support */
#undef HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `isatty' function. */
#undef HAVE_ISATTY
/* Define if you have the strerror function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <kernel/OS.h> header file. */
#undef HAVE_KERNEL_OS_H
/* Define if you have the strtod function. */
#undef HAVE_STRTOD
/* Define to 1 if you have the <kernel/scheduler.h> header file. */
#undef HAVE_KERNEL_SCHEDULER_H
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
/* Define if you have the strtoul function. */
#undef HAVE_STRTOUL
/* Define if your <locale.h> file defines LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define if you have the swab function. */
#undef HAVE_SWAB
/* Define to 1 if you have the `pth' library (-lpth). */
#undef HAVE_LIBPTH
/* Define if you have the tsearch function. */
#undef HAVE_TSEARCH
/* Define to 1 if you have the `st' library (-lst). */
#undef HAVE_LIBST
/* Define if you have the usleep function. */
#undef HAVE_USLEEP
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the vasprintf function. */
#undef HAVE_VASPRINTF
/* Define to 1 if you have the <linux/fb.h> header file. */
#undef HAVE_LINUX_FB_H
/* Define if you have the <Cocoa/Cocoa.h> header file. */
#undef HAVE_COCOA_COCOA_H
/* Define to 1 if you have the <linux/version.h> header file. */
#undef HAVE_LINUX_VERSION_H
/* Define if you have the <Ph.h> header file. */
#undef HAVE_PH_H
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define if you have the <X11/Xlib.h> header file. */
#undef HAVE_X11_XLIB_H
/* Define to 1 if you have the <machine/param.h> header file. */
#undef HAVE_MACHINE_PARAM_H
/* Define if you have the <X11/extensions/Xv.h> header file. */
#undef HAVE_X11_EXTENSIONS_XV_H
/* Define to 1 if you have the <machine/soundcard.h> header file. */
#undef HAVE_MACHINE_SOUNDCARD_H
/* Define if you have the <X11/extensions/dpms.h> header file. */
#undef HAVE_X11_EXTENSIONS_DPMS_H
/* Define to 1 if you have the <mad.h> header file. */
#undef HAVE_MAD_H
/* Define if you have the <a52dec/a52.h> header file. */
#undef HAVE_A52DEC_A52_H
/* Define to 1 if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define to 1 if you have the `memalign' function. */
#undef HAVE_MEMALIGN
/* Define if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if you have the <cthreads.h> header file. */
#undef HAVE_CTHREADS_H
/* Define to 1 if you have the `mempcpy' function. */
#undef HAVE_MEMPCPY
/* Define if you have the <ddraw.h> header file. */
#undef HAVE_DDRAW_H
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `munmap' function. */
#undef HAVE_MUNMAP
/* Define if you have the <dvdcss/dvdcss.h> header file. */
#undef HAVE_DVDCSS_DVDCSS_H
/* Define to 1 if you have the `nanosleep' function. */
#undef HAVE_NANOSLEEP
/* Define if you have the <dvdread/dvd_reader.h> header file. */
#undef HAVE_DVDREAD_DVD_READER_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H
/* Define if you have the <gdk/gdk.h> header file. */
#undef HAVE_GDK_GDK_H
/* Define to 1 if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the <ogg/ogg.h> header file. */
#undef HAVE_OGG_OGG_H
/* Define if you have the <glib.h> header file. */
#undef HAVE_GLIB_H
/* Define to 1 if you have the <Ph.h> header file. */
#undef HAVE_PH_H
/* Define if you have the <gnome.h> header file. */
#undef HAVE_GNOME_H
/* Define to 1 if you have the `posix_memalign' function. */
#undef HAVE_POSIX_MEMALIGN
/* Define if you have the <gtk/gtk.h> header file. */
#undef HAVE_GTK_GTK_H
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
/* Define if you have the <image.h> header file. */
#undef HAVE_IMAGE_H
/* Define to 1 if you have the `putenv' function. */
#undef HAVE_PUTENV
/* Define if you have the <kernel/OS.h> header file. */
#undef HAVE_KERNEL_OS_H
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define if you have the <kernel/scheduler.h> header file. */
#undef HAVE_KERNEL_SCHEDULER_H
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
/* Define if you have the <linux/fb.h> header file. */
#undef HAVE_LINUX_FB_H
/* Define to 1 if you have the `sigrelse' function. */
#undef HAVE_SIGRELSE
/* Define if you have the <linux/version.h> header file. */
#undef HAVE_LINUX_VERSION_H
/* Define to 1 if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
/* Define if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define if you have the <machine/param.h> header file. */
#undef HAVE_MACHINE_PARAM_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define if you have the <machine/soundcard.h> header file. */
#undef HAVE_MACHINE_SOUNDCARD_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the <mad.h> header file. */
#undef HAVE_MAD_H
/* Define to 1 if you have the `stpcpy' function. */
#undef HAVE_STPCPY
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define if you have the <net/if.h> header file. */
#undef HAVE_NET_IF_H
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define if you have the <ogg/ogg.h> header file. */
#undef HAVE_OGG_OGG_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
/* Define to 1 if you have the `strtod' function. */
#undef HAVE_STRTOD
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if the system has the type `struct timespec'. */
#undef HAVE_STRUCT_TIMESPEC
/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the `swab' function. */
#undef HAVE_SWAB
/* Define if you have the <sys/param.h> header file. */
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define if you have the <sys/shm.h> header file. */
/* Define to 1 if you have the <sys/shm.h> header file. */
#undef HAVE_SYS_SHM_H
/* Define if you have the <sys/socket.h> header file. */
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define if you have the <sys/sockio.h> header file. */
/* Define to 1 if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
/* Define if you have the <sys/soundcard.h> header file. */
/* Define to 1 if you have the <sys/soundcard.h> header file. */
#undef HAVE_SYS_SOUNDCARD_H
/* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define if you have the <sys/times.h> header file. */
/* Define to 1 if you have the <sys/times.h> header file. */
#undef HAVE_SYS_TIMES_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the mad library (-lmad). */
#undef HAVE_LIBMAD
/* Define if you have the pth library (-lpth). */
#undef HAVE_LIBPTH
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the st library (-lst). */
#undef HAVE_LIBST
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Package name */
#undef VLC_PACKAGE
/* Define to 1 if you have the `tsearch' function. */
#undef HAVE_TSEARCH
/* Package version */
#undef VLC_VERSION
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
/* Support for variadic macros */
#undef HAVE_VARIADIC_MACROS
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
/* Define to 1 if you have the <X11/extensions/dpms.h> header file. */
#undef HAVE_X11_EXTENSIONS_DPMS_H
/* Define if your <locale.h> file defines LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if you have the <X11/extensions/Xv.h> header file. */
#undef HAVE_X11_EXTENSIONS_XV_H
/* Define to 1 if translation of program messages to the user's native language
is requested. */
#undef ENABLE_NLS
/* Define to 1 if you have the <X11/Xlib.h> header file. */
#undef HAVE_X11_XLIB_H
/* Define if the GNU gettext() function is already present or preinstalled. */
#undef HAVE_GETTEXT
/* Define to 1 if you have the `__argz_count' function. */
#undef HAVE___ARGZ_COUNT
/* long getopt support */
#undef HAVE_GETOPT_LONG
/* Define to 1 if you have the `__argz_next' function. */
#undef HAVE___ARGZ_NEXT
/* getopt support */
#undef HAVE_GETOPT_LONG
/* Define to 1 if you have the `__argz_stringify' function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define if <pthread.h> defines pthread_cond_t. */
#undef PTHREAD_COND_T_IN_PTHREAD_H
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
/* Define if <strings.h> defines strncasecmp. */
#undef STRNCASECMP_IN_STRINGS_H
/* String suffix for module functions */
#undef MODULE_SUFFIX
/* Define if <X11/extensions/dpms.h> defines DPMSInfo. */
#undef DPMSINFO_IN_DPMS_H
/* Symbol suffix for module functions */
#undef MODULE_SYMBOL
/* Define if <sys/param.h> defines ntohl. */
#undef NTOHL_IN_SYS_PARAM_H
/* Support for variadic macros */
#undef HAVE_VARIADIC_MACROS
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Maximum supported data alignment */
#undef ATTRIBUTE_ALIGNED_MAX
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define if <sys/types.h> defines boolean_t. */
#undef BOOLEAN_T_IN_SYS_TYPES_H
/* Define if <pthread.h> defines boolean_t. */
#undef BOOLEAN_T_IN_PTHREAD_H
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define if <cthreads.h> defines boolean_t. */
#undef BOOLEAN_T_IN_CTHREADS_H
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define if $CC groks 3D Now! inline assembly. */
#undef CAN_COMPILE_3DNOW
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define if $CC groks SSE inline assembly. */
#undef CAN_COMPILE_SSE
/* Define if $CC groks ALTIVEC inline assembly. */
#undef CAN_COMPILE_ALTIVEC
/* Define if <pthread.h> defines pthread_cond_t. */
#undef PTHREAD_COND_T_IN_PTHREAD_H
/* Define if your compiler groks C altivec extensions. */
#undef CAN_COMPILE_C_ALTIVEC
/* Define if <pth.h> defines pth_init */
#undef PTH_INIT_IN_PTH_H
/* For FreeBSD VCD support */
#undef HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Indicate whether we should use SDL/SDL.h or SDL11/SDL.h */
#undef SDL_INCLUDE_FILE
/* big endian system */
#undef WORDS_BIGENDIAN
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define if <pth.h> defines pth_init */
#undef PTH_INIT_IN_PTH_H
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if <strings.h> defines strncasecmp. */
#undef STRNCASECMP_IN_STRINGS_H
/* Define if <st.h> defines st_init */
#undef ST_INIT_IN_ST_H
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Simple version string */
#undef VERSION_MESSAGE
/* Copyright string */
#undef COPYRIGHT_MESSAGE
/* Package name */
#undef VLC_PACKAGE
/* String suffix for module functions */
#undef MODULE_SUFFIX
/* Package version */
#undef VLC_VERSION
/* Symbol suffix for module functions */
#undef MODULE_SYMBOL
/* big endian system */
#undef WORDS_BIGENDIAN
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
if it is not supported. */
#undef inline
/* Define to `long' if <sys/types.h> does not define. */
#undef off_t
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
......@@ -3,7 +3,7 @@
* Functions are prototyped in mtime.h.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: mtime.c,v 1.29 2002/05/17 15:14:47 lool Exp $
* $Id: mtime.c,v 1.30 2002/05/17 16:38:41 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -52,6 +52,18 @@
# include <sys/time.h>
#endif
#if defined(HAVE_NANOSLEEP) && !defined(HAVE_STRUCT_TIMESPEC)
struct timespec
{
time_t tv_sec;
long tv_sec;
};
#endif
#if defined(HAVE_NANOSLEEP) && !defined(HAVE_DECL_NANOSLEEP)
int nanosleep(struct timespec *, struct timespec *);
#endif
/*****************************************************************************
* mstrtime: return a date in a readable format
*****************************************************************************
......@@ -141,7 +153,7 @@ void mwait( mtime_t date )
#else
struct timeval tv_date, tv_delay;
struct timeval tv_date;
mtime_t delay; /* delay in msec, signed to detect errors */
/* see mdate() about gettimeofday() possible errors */
......@@ -166,10 +178,22 @@ void mwait( mtime_t date )
st_usleep( delay );
# else
tv_delay.tv_sec = delay / 1000000;
tv_delay.tv_usec = delay % 1000000;
# if defined( HAVE_NANOSLEEP )
{
struct timespec ts_delay;
ts_delay.tv_sec = delay / 1000000;
ts_delay.tv_nsec = (delay % 1000000) * 1000;
nanosleep( &ts_delay, NULL );
}
# else
tv_date.tv_sec = delay / 1000000;
tv_date.tv_usec = delay % 1000000;
/* see msleep() about select() errors */
select( 0, NULL, NULL, NULL, &tv_delay );
select( 0, NULL, NULL, NULL, &tv_date );
# endif
# endif
......@@ -195,15 +219,24 @@ void msleep( mtime_t delay )
#elif defined( WIN32 )
Sleep( (int) (delay / 1000) );
#elif defined( HAVE_NANOSLEEP )
struct timespec ts_delay;
ts_delay.tv_sec = delay / 1000000;
ts_delay.tv_nsec = (delay % 1000000) * 1000;
nanosleep( &ts_delay, NULL );
#else
struct timeval tv_delay;
tv_delay.tv_sec = delay / 1000000;
tv_delay.tv_usec = delay % 1000000;
/* select() return value should be tested, since several possible errors
* can occur. However, they should only happen in very particular occasions
* (i.e. when a signal is sent to the thread, or when memory is full), and
* can be ingnored. */
* can be ignored. */
select( 0, NULL, NULL, NULL, &tv_delay );
#endif
......
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