From 15b6ed2951acc37eb76037ebb786ab827a2c8031 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Sun, 28 Sep 2008 17:55:09 +0200 Subject: Fix xine_usec_sleep for mingw+msys Bug was found and fixed by Carlo Bramini. select() does not work on mingw+msys causing xine_usec_sleep to sleep much longer than requested which completely broke audio playback --- src/xine-utils/utils.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/xine-utils') diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 57a92623c..689b68502 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -456,23 +456,22 @@ char *xine_chomp(char *str) { * a thread-safe usecond sleep */ void xine_usec_sleep(unsigned usec) { -#if 0 -#if HAVE_NANOSLEEP +#ifdef WIN32 + /* select does not work on win32 */ + Sleep(usec / 1000); +#else +# if 0 +# if HAVE_NANOSLEEP /* nanosleep is prefered on solaris, because it's mt-safe */ struct timespec ts, remaining; - ts.tv_sec = usec / 1000000; ts.tv_nsec = (usec % 1000000) * 1000; while (nanosleep (&ts, &remaining) == -1 && errno == EINTR) ts = remaining; -#else -# if WIN32 - Sleep(usec / 1000); -# else +# else usleep(usec); -# endif -#endif -#else +# endif +# else if (usec < 10000) { usec = 10000; } @@ -480,6 +479,7 @@ void xine_usec_sleep(unsigned usec) { tm.tv_sec = usec / 1000000; tm.tv_usec = usec % 1000000; select(0, 0, 0, 0, &tm); +# endif #endif } -- cgit v1.2.3 From ea2b5508e35f5125fd65730822b30bb8895ad87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 20 Nov 2008 20:56:19 +0100 Subject: Some warning fixes: XINE_FORMAT_SCANF, statics in headers, consts, ... Add warning flags to the DEBUG_CFLAGS too. --- src/xine-utils/attributes.h | 6 ++++-- src/xine-utils/monitor.c | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/xine-utils') diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h index 3819818d5..d7a0e2f1e 100644 --- a/src/xine-utils/attributes.h +++ b/src/xine-utils/attributes.h @@ -1,7 +1,7 @@ /* * attributes.h * Copyright (C) 1999-2000 Aaron Holtzman - * Copyright (C) 2001-2007 xine developers + * Copyright (C) 2001-2008 xine developers * * This file was originally part of mpeg2dec, a free MPEG-2 video stream * decoder. @@ -72,7 +72,7 @@ # define XINE_SENTINEL #endif -#ifdef SUPPORT_ATTRIBUTE_DEPRECATED +#if defined(SUPPORT_ATTRIBUTE_DEPRECATED) && !defined(XINE_COMPILE) # define XINE_DEPRECATED __attribute__((__deprecated__)) #else # define XINE_DEPRECATED @@ -89,8 +89,10 @@ /* Format attributes */ #ifdef SUPPORT_ATTRIBUTE_FORMAT # define XINE_FORMAT_PRINTF(fmt,var) __attribute__((__format__(__printf__, fmt, var))) +# define XINE_FORMAT_SCANF(fmt,var) __attribute__((__format__(__scanf__, fmt, var))) #else # define XINE_FORMAT_PRINTF(fmt,var) +# define XINE_FORMAT_SCANF(fmt,var) #endif #ifdef SUPPORT_ATTRIBUTE_FORMAT_ARG # define XINE_FORMAT_PRINTF_ARG(fmt) __attribute__((__format_arg__(fmt))) diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c index 301d6c22f..650c10f99 100644 --- a/src/xine-utils/monitor.c +++ b/src/xine-utils/monitor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -38,7 +38,6 @@ static long profiler_calls[MAX_ID] ; static const char *profiler_label[MAX_ID] ; void xine_profiler_init () { - int i; memset(profiler_times, 0, sizeof(profiler_times)); memset(profiler_start, 0, sizeof(profiler_start)); memset(profiler_calls, 0, sizeof(profiler_calls)); -- cgit v1.2.3