diff options
-rw-r--r-- | lib/os_internal.h | 90 | ||||
-rw-r--r-- | src/input/libdvdnav/bswap.h | 2 | ||||
-rw-r--r-- | src/input/libdvdnav/diff_against_cvs.patch | 172 | ||||
-rw-r--r-- | src/input/libdvdnav/dvd_reader.c | 13 | ||||
-rw-r--r-- | src/input/libdvdnav/dvd_reader.h | 4 | ||||
-rw-r--r-- | src/input/libdvdnav/dvdnav_internal.h | 41 | ||||
-rw-r--r-- | src/input/libdvdnav/remap.c | 9 | ||||
-rw-r--r-- | src/input/libdvdnav/searching.c | 3 |
8 files changed, 278 insertions, 56 deletions
diff --git a/lib/os_internal.h b/lib/os_internal.h index bffcb6ecb..c427448c4 100644 --- a/lib/os_internal.h +++ b/lib/os_internal.h @@ -34,102 +34,118 @@ /* replacement of strndup */ #ifndef HAVE_STRNDUP -#define strndup(S, N) _xine_private_strndup((S), (N)) -char *_xine_private_strndup(const char *s, size_t n); +#define HAVE_STRNDUP +#define strndup(S, N) xine_private_strndup((S), (N)) +char *xine_private_strndup(const char *s, size_t n); #endif /* replacement of basename */ #ifndef HAVE_BASENAME -#define basename(PATH) _xine_private_basename((PATH)) -char *_xine_private_basename(char *path); +#define HAVE_BASENAME +#define basename(PATH) xine_private_basename((PATH)) +char *xine_private_basename(char *path); #endif /* replacement of hstrerror */ #ifndef HAVE_HSTRERROR -#define hstrerror(ERR) _xine_private_hstrerror((ERR)) -const char *_xine_private_hstrerror(int err); +#define HAVE_HSTRERROR +#define hstrerror(ERR) xine_private_hstrerror((ERR)) +const char *xine_private_hstrerror(int err); #endif /* replacement of setenv */ #ifndef HAVE_SETENV -#define setenv(NAME, VALUE, OVERWRITE) _xine_private_setenv((NAME), (VALUE)) -int _xine_private_setenv(const char *name, const char *value); +#define HAVE_SETENV +#define setenv(NAME, VALUE, OVERWRITE) xine_private_setenv((NAME), (VALUE)) +int xine_private_setenv(const char *name, const char *value); #endif /* replacement of strtok_r */ #ifndef HAVE_STRTOK_R -#define strtok_r(S, DELIM, PTRPTR) _xine_private_strtok_r((S), (DELIM), (PTRPTR)) -char *_xine_private_strtok_r(char *s, const char *delim, char **ptrptr); +#define HAVE_STRTOK_R +#define strtok_r(S, DELIM, PTRPTR) xine_private_strtok_r((S), (DELIM), (PTRPTR)) +char *xine_private_strtok_r(char *s, const char *delim, char **ptrptr); #endif /* replacement of gettimeofday */ #ifndef HAVE_GETTIMEOFDAY +# define HAVE_GETTIMEOFDAY # ifdef WIN32 # include <winsock.h> struct timezone; # else # include <sys/time.h> # endif -# define gettimeofday(TV, TZ) _xine_private_gettimeofday((TV)) -int _xine_private_gettimeofday(struct timeval *tv); +# define gettimeofday(TV, TZ) xine_private_gettimeofday((TV)) +int xine_private_gettimeofday(struct timeval *tv); #endif /* replacement of strpbrk */ #ifndef HAVE_STRPBRK -#define strpbrk(S, ACCEPT) _xine_private_strpbrk((S), (ACCEPT)) -char *_xine_private_strpbrk(const char *s, const char *accept); +#define HAVE_STRPBRK +#define strpbrk(S, ACCEPT) xine_private_strpbrk((S), (ACCEPT)) +char *xine_private_strpbrk(const char *s, const char *accept); #endif /* replacement of strsep */ #ifndef HAVE_STRSEP -#define strsep(STRINGP, DELIM) _xine_private_strsep((STRINGP), (DELIM)) -char *_xine_private_strsep(char **stringp, const char *delim); +#define HAVE_STRSEP +#define strsep(STRINGP, DELIM) xine_private_strsep((STRINGP), (DELIM)) +char *xine_private_strsep(char **stringp, const char *delim); #endif /* replacement of timegm */ #ifndef HAVE_TIMEGM +#define HAVE_TIMEGM #include <time.h> -#define timegm(TM) _xine_private_timegm((TM)) -time_t _xine_private_timegm(struct tm *tm); +#define timegm(TM) xine_private_timegm((TM)) +time_t xine_private_timegm(struct tm *tm); #endif /* replacement of unsetenv */ #ifndef HAVE_UNSETENV -#define unsetenv(NAME) _xine_private_unsetenv((NAME)) -void _xine_private_unsetenv(const char *name); +#define HAVE_UNSETENV +#define unsetenv(NAME) xine_private_unsetenv((NAME)) +void xine_private_unsetenv(const char *name); #endif /* replacement of asprintf & vasprintf */ #ifndef HAVE_ASPRINTF +#define HAVE_ASPRINTF #ifdef __GNUC__ - #define asprintf(STRINGPP, FORMAT, ARGS...) _xine_private_asprintf((STRINGPP), FORMAT, ##ARGS) + #define asprintf(STRINGPP, FORMAT, ARGS...) xine_private_asprintf((STRINGPP), FORMAT, ##ARGS) #elif defined (_MSC_VER) - #define asprintf(STRINGPP, FORMATARGS) _xine_private_asprintf((STRINGPP), FORMATARGS) + #define asprintf(STRINGPP, FORMATARGS) xine_private_asprintf((STRINGPP), FORMATARGS) #else - #define asprintf(STRINGPP, FORMAT, ...) _xine_private_asprintf((STRINGPP), FORMAT, __VA_ARGS__) + #define asprintf(STRINGPP, FORMAT, ...) xine_private_asprintf((STRINGPP), FORMAT, __VA_ARGS__) #endif #define vasprintf(STRINGPP, FORMAT, VA_ARG) _xine_private_vasprintf((STRINGPP), (FORMAT), (VA_ARG)) -int _xine_private_asprintf(char **string, const char *format, ...) __attribute__ ((format (printf, 2, 3))); -int _xine_private_vasprintf(char **string, const char *format, va_list ap) __attribute__ ((format (printf, 2, 0))); +int xine_private_asprintf(char **string, const char *format, ...) __attribute__ ((format (printf, 2, 3))); +int xine_private_vasprintf(char **string, const char *format, va_list ap) __attribute__ ((format (printf, 2, 0))); #endif /* replacement of strndup */ #ifndef HAVE_STRNDUP -#define strndup(S, N) _xine_private_strndup((S), (N)) -char *_xine_private_strndup(const char *s, size_t n); +#define HAVE_STRNDUP +#define strndup(S, N) xine_private_strndup((S), (N)) +char *xine_private_strndup(const char *s, size_t n); #endif /* handle non-standard function names */ #if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF) +# define HAVE_SNPRINTF # define snprintf _snprintf #endif #if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF) +# define HAVE_VSNPRINTF # define vsnprintf _vsnprintf #endif #if !defined(HAVE_STRCASECMP) && defined(HAVE__STRICMP) +# define HAVE_STRCASECMP # define strcasecmp _stricmp #endif #if !defined(HAVE_STRNCASECMP) && defined(HAVE__STRNICMP) +# define HAVE_STRNCASECMP # define strncasecmp _strnicmp #endif @@ -138,9 +154,11 @@ char *_xine_private_strndup(const char *s, size_t n); # define M_PI 3.14159265358979323846 #endif #ifndef HAVE_LRINTF +#define HAVE_LRINTF #define lrint(X) (long)((X) + ((X) >= 0 ? 0.5 : -0.5)) #endif #ifndef HAVE_RINTF +#define HAVE_RINTF #define rint(X) (int)((X) + ((X) >= 0 ? 0.5 : -0.5)) #endif @@ -226,11 +244,13 @@ char *_xine_private_strndup(const char *s, size_t n); /* replacing lstat by stat */ #ifndef HAVE_LSTAT +# define HAVE_LSTAT # define lstat(FILENAME, BUF) stat((FILENAME), (BUF)) #endif /* replacements of dirent for MSVC platform */ #ifndef HAVE_OPENDIR +#define HAVE_OPENDIR typedef struct DIR DIR; struct dirent { @@ -238,15 +258,15 @@ struct dirent { char *d_name; }; -DIR *_xine_private_opendir(const char *); -int _xine_private_closedir(DIR *); -struct dirent *_xine_private_readdir(DIR *); -void _xine_private_rewinddir(DIR *); +DIR *xine_private_opendir(const char *); +int xine_private_closedir(DIR *); +struct dirent *xine_private_readdir(DIR *); +void xine_private_rewinddir(DIR *); -#define opendir(DIRENT_NAME) _xine_private_opendir((DIRENT_NAME)) -#define closedir(DIRENT_DIR) _xine_private_closedir((DIRENT_DIR)) -#define readdir(DIRENT_DIR) _xine_private_readdir((DIRENT_DIR)) -#define rewinddir(DIRENT_DIR) _xine_private_rewinddir((DIRENT_DIR)) +#define opendir(DIRENT_NAME) xine_private_opendir((DIRENT_NAME)) +#define closedir(DIRENT_DIR) xine_private_closedir((DIRENT_DIR)) +#define readdir(DIRENT_DIR) xine_private_readdir((DIRENT_DIR)) +#define rewinddir(DIRENT_DIR) xine_private_rewinddir((DIRENT_DIR)) #endif diff --git a/src/input/libdvdnav/bswap.h b/src/input/libdvdnav/bswap.h index dc4d6f655..7d7acd556 100644 --- a/src/input/libdvdnav/bswap.h +++ b/src/input/libdvdnav/bswap.h @@ -35,7 +35,7 @@ #include <sys/param.h> #endif -#if defined(__linux__) +#if defined(__linux__) || defined(__GLIBC__) #include <byteswap.h> #define B2N_16(x) x = bswap_16(x) #define B2N_32(x) x = bswap_32(x) diff --git a/src/input/libdvdnav/diff_against_cvs.patch b/src/input/libdvdnav/diff_against_cvs.patch index da00d8fd6..6afca3a98 100644 --- a/src/input/libdvdnav/diff_against_cvs.patch +++ b/src/input/libdvdnav/diff_against_cvs.patch @@ -247,3 +247,175 @@ diff -u -r1.2 md5.c #include "md5.h" /* #include "unlocked-io.h" */ +Index: src/input/libdvdnav/bswap.h +=================================================================== +RCS file: /cvsroot/xine/xine-lib/src/input/libdvdnav/bswap.h,v +retrieving revision 1.3 +diff -u -p -u -r1.3 bswap.h +--- src/input/libdvdnav/bswap.h 26 May 2003 23:11:44 -0000 1.3 ++++ src/input/libdvdnav/bswap.h 17 Sep 2006 12:50:16 -0000 +@@ -35,7 +35,7 @@ + #include <sys/param.h> + #endif + +-#if defined(__linux__) ++#if defined(__linux__) || defined(__GLIBC__) + #include <byteswap.h> + #define B2N_16(x) x = bswap_16(x) + #define B2N_32(x) x = bswap_32(x) +Index: src/input/libdvdnav/dvd_reader.c +=================================================================== +RCS file: /cvsroot/xine/xine-lib/src/input/libdvdnav/dvd_reader.c,v +retrieving revision 1.13 +diff -u -p -u -r1.13 dvd_reader.c +--- src/input/libdvdnav/dvd_reader.c 15 Jun 2006 14:26:40 -0000 1.13 ++++ src/input/libdvdnav/dvd_reader.c 17 Sep 2006 12:50:16 -0000 +@@ -32,8 +32,13 @@ + #include <limits.h> + #include <dirent.h> + +-/* misc win32 helpers */ +-#ifdef WIN32 ++#ifndef HAVE_GETTIMEOFDAY ++# ifdef WIN32 ++# include <winsock.h> ++struct timezone; ++# else ++# include <sys/time.h> ++# endif + /* replacement gettimeofday implementation */ + #include <sys/timeb.h> + static inline int _private_gettimeofday( struct timeval *tv, void *tz ) +@@ -45,6 +50,10 @@ static inline int _private_gettimeofday( + return 0; + } + #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) ++#endif ++ ++/* misc win32 helpers */ ++#ifdef WIN32 + #include <io.h> /* read() */ + #define lseek64 _lseeki64 + #endif +Index: src/input/libdvdnav/dvd_reader.h +=================================================================== +RCS file: /cvsroot/xine/xine-lib/src/input/libdvdnav/dvd_reader.h,v +retrieving revision 1.5 +diff -u -p -u -r1.5 dvd_reader.h +--- src/input/libdvdnav/dvd_reader.h 16 Mar 2004 11:43:38 -0000 1.5 ++++ src/input/libdvdnav/dvd_reader.h 17 Sep 2006 12:50:16 -0000 +@@ -21,9 +21,11 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +-#ifdef _MSC_VER ++#ifdef HAVE_CONFIG_H + #include <config.h> ++#endif + ++#ifdef _MSC_VER + #include <stdio.h> + #include <stdlib.h> + #endif +Index: src/input/libdvdnav/dvdnav_internal.h +=================================================================== +RCS file: /cvsroot/xine/xine-lib/src/input/libdvdnav/dvdnav_internal.h,v +retrieving revision 1.15 +diff -u -p -u -r1.15 dvdnav_internal.h +--- src/input/libdvdnav/dvdnav_internal.h 20 Sep 2004 19:30:04 -0000 1.15 ++++ src/input/libdvdnav/dvdnav_internal.h 17 Sep 2006 12:50:16 -0000 +@@ -34,6 +34,34 @@ + #include <limits.h> + #include <string.h> + ++#ifndef HAVE_GETTIMEOFDAY ++# ifdef WIN32 ++# include <winsock.h> ++struct timezone; ++# else ++# include <sys/time.h> ++# endif ++/* replacement gettimeofday implementation */ ++#include <sys/timeb.h> ++static inline int dvdnav_private_gettimeofday( struct timeval *tv, void *tz ) ++{ ++ struct timeb t; ++ ftime( &t ); ++ tv->tv_sec = t.time; ++ tv->tv_usec = t.millitm * 1000; ++ return 0; ++} ++#define gettimeofday(TV, TZ) dvdnav_private_gettimeofday((TV), (TZ)) ++#define HAVE_GETTIMEOFDAY 1 ++#endif ++ ++#ifndef HAVE_SNPRINTF ++# ifdef HAVE__SNPRINTF ++# define snprintf _snprintf ++# define HAVE_SNPRINTF 1 ++# endif ++#endif ++ + #ifdef WIN32 + + /* pthread_mutex_* wrapper for win32 */ +@@ -45,17 +73,6 @@ typedef CRITICAL_SECTION pthread_mutex_t + #define pthread_mutex_unlock(a) LeaveCriticalSection(a) + #define pthread_mutex_destroy(a) + +-/* replacement gettimeofday implementation */ +-#include <sys/timeb.h> +-static inline int _private_gettimeofday( struct timeval *tv, void *tz ) +-{ +- struct timeb t; +- ftime( &t ); +- tv->tv_sec = t.time; +- tv->tv_usec = t.millitm * 1000; +- return 0; +-} +-#define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) + #include <io.h> /* read() */ + #define lseek64 _lseeki64 + +Index: src/input/libdvdnav/remap.c +=================================================================== +RCS file: /cvsroot/xine/xine-lib/src/input/libdvdnav/remap.c,v +retrieving revision 1.4 +diff -u -p -u -r1.4 remap.c +--- src/input/libdvdnav/remap.c 25 Aug 2003 21:51:40 -0000 1.4 ++++ src/input/libdvdnav/remap.c 17 Sep 2006 12:50:16 -0000 +@@ -22,14 +22,17 @@ + #include <string.h> + #include <stdio.h> + +-#ifndef _MSC_VER ++#ifdef HAVE_SYS_PARAM_H + #include <sys/param.h> ++#endif ++ ++#ifdef HAVE_SYS_FCNTL_H + #include <sys/fcntl.h> + #else + #ifndef MAXPATHLEN + #define MAXPATHLEN 255 + #endif +-#endif /* _MSC_VER */ ++#endif /* HAVE fcntl.h */ + + #include <assert.h> + #include "remap.h" +Index: src/input/libdvdnav/searching.c +=================================================================== +RCS file: /cvsroot/xine/xine-lib/src/input/libdvdnav/searching.c,v +retrieving revision 1.19 +diff -u -p -u -r1.19 searching.c +--- src/input/libdvdnav/searching.c 14 Oct 2005 21:02:16 -0000 1.19 ++++ src/input/libdvdnav/searching.c 17 Sep 2006 12:50:16 -0000 +@@ -105,7 +105,6 @@ dvdnav_status_t dvdnav_time_search(dvdna + int32_t found; + cell_playback_t *cell; + dvd_state_t *state; +- dvdnav_status_t result; + + if(this->position_current.still != 0) { + printerr("Cannot seek in a still frame."); diff --git a/src/input/libdvdnav/dvd_reader.c b/src/input/libdvdnav/dvd_reader.c index 6997f5bb2..e71d6ca42 100644 --- a/src/input/libdvdnav/dvd_reader.c +++ b/src/input/libdvdnav/dvd_reader.c @@ -32,8 +32,13 @@ #include <limits.h> #include <dirent.h> -/* misc win32 helpers */ -#ifdef WIN32 +#ifndef HAVE_GETTIMEOFDAY +# ifdef WIN32 +# include <winsock.h> +struct timezone; +# else +# include <sys/time.h> +# endif /* replacement gettimeofday implementation */ #include <sys/timeb.h> static inline int _private_gettimeofday( struct timeval *tv, void *tz ) @@ -45,6 +50,10 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz ) return 0; } #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) +#endif + +/* misc win32 helpers */ +#ifdef WIN32 #include <io.h> /* read() */ #define lseek64 _lseeki64 #endif diff --git a/src/input/libdvdnav/dvd_reader.h b/src/input/libdvdnav/dvd_reader.h index 9bfba3ee1..abaa882d0 100644 --- a/src/input/libdvdnav/dvd_reader.h +++ b/src/input/libdvdnav/dvd_reader.h @@ -21,9 +21,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef _MSC_VER +#ifdef HAVE_CONFIG_H #include <config.h> +#endif +#ifdef _MSC_VER #include <stdio.h> #include <stdlib.h> #endif diff --git a/src/input/libdvdnav/dvdnav_internal.h b/src/input/libdvdnav/dvdnav_internal.h index 35d9f3470..d6e8bef5b 100644 --- a/src/input/libdvdnav/dvdnav_internal.h +++ b/src/input/libdvdnav/dvdnav_internal.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: dvdnav_internal.h,v 1.15 2004/09/20 19:30:04 valtri Exp $ + * $Id: dvdnav_internal.h,v 1.16 2006/09/17 13:01:08 valtri Exp $ * */ @@ -34,6 +34,34 @@ #include <limits.h> #include <string.h> +#ifndef HAVE_GETTIMEOFDAY +# ifdef WIN32 +# include <winsock.h> +struct timezone; +# else +# include <sys/time.h> +# endif +/* replacement gettimeofday implementation */ +#include <sys/timeb.h> +static inline int dvdnav_private_gettimeofday( struct timeval *tv, void *tz ) +{ + struct timeb t; + ftime( &t ); + tv->tv_sec = t.time; + tv->tv_usec = t.millitm * 1000; + return 0; +} +#define gettimeofday(TV, TZ) dvdnav_private_gettimeofday((TV), (TZ)) +#define HAVE_GETTIMEOFDAY 1 +#endif + +#ifndef HAVE_SNPRINTF +# ifdef HAVE__SNPRINTF +# define snprintf _snprintf +# define HAVE_SNPRINTF 1 +# endif +#endif + #ifdef WIN32 /* pthread_mutex_* wrapper for win32 */ @@ -45,17 +73,6 @@ typedef CRITICAL_SECTION pthread_mutex_t; #define pthread_mutex_unlock(a) LeaveCriticalSection(a) #define pthread_mutex_destroy(a) -/* replacement gettimeofday implementation */ -#include <sys/timeb.h> -static inline int _private_gettimeofday( struct timeval *tv, void *tz ) -{ - struct timeb t; - ftime( &t ); - tv->tv_sec = t.time; - tv->tv_usec = t.millitm * 1000; - return 0; -} -#define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) #include <io.h> /* read() */ #define lseek64 _lseeki64 diff --git a/src/input/libdvdnav/remap.c b/src/input/libdvdnav/remap.c index 8fffc6e29..86cf3a4ad 100644 --- a/src/input/libdvdnav/remap.c +++ b/src/input/libdvdnav/remap.c @@ -15,21 +15,24 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: remap.c,v 1.4 2003/08/25 21:51:40 f1rmb Exp $ + * $Id: remap.c,v 1.5 2006/09/17 13:01:08 valtri Exp $ */ #include <stdlib.h> #include <string.h> #include <stdio.h> -#ifndef _MSC_VER +#ifdef HAVE_SYS_PARAM_H #include <sys/param.h> +#endif + +#ifdef HAVE_SYS_FCNTL_H #include <sys/fcntl.h> #else #ifndef MAXPATHLEN #define MAXPATHLEN 255 #endif -#endif /* _MSC_VER */ +#endif /* HAVE fcntl.h */ #include <assert.h> #include "remap.h" diff --git a/src/input/libdvdnav/searching.c b/src/input/libdvdnav/searching.c index 1ff110783..3da9efecf 100644 --- a/src/input/libdvdnav/searching.c +++ b/src/input/libdvdnav/searching.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: searching.c,v 1.19 2005/10/14 21:02:16 miguelfreitas Exp $ + * $Id: searching.c,v 1.20 2006/09/17 13:01:08 valtri Exp $ * */ @@ -105,7 +105,6 @@ dvdnav_status_t dvdnav_time_search(dvdnav_t *this, int32_t found; cell_playback_t *cell; dvd_state_t *state; - dvdnav_status_t result; if(this->position_current.still != 0) { printerr("Cannot seek in a still frame."); |