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