diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/audio_out/audio_directx2_out.c | 4 | ||||
-rw-r--r-- | src/input/input_cdda.c | 4 | ||||
-rw-r--r-- | src/video_out/Makefile.am | 2 | ||||
-rwxr-xr-x | src/video_out/video_out_directx.c | 6 | ||||
-rw-r--r-- | src/xine-engine/Makefile.am | 2 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 8 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 6 | ||||
-rw-r--r-- | src/xine-utils/utils.c | 185 | ||||
-rw-r--r-- | src/xine-utils/xineutils.h | 15 |
9 files changed, 128 insertions, 104 deletions
diff --git a/src/audio_out/audio_directx2_out.c b/src/audio_out/audio_directx2_out.c index a86920e0f..97d3c8cd1 100644 --- a/src/audio_out/audio_directx2_out.c +++ b/src/audio_out/audio_directx2_out.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: audio_directx2_out.c,v 1.2 2005/02/06 19:16:18 valtri Exp $ + * $Id: audio_directx2_out.c,v 1.3 2005/08/29 15:28:16 valtri Exp $ * * * xine audio output plugin using DirectX @@ -176,7 +176,7 @@ static char *dsound_strerror(HRESULT err) { case DSERR_BUFFERLOST: return _("memory buffer has been lost and must be restored"); case DSERR_CONTROLUNAVAIL: return _("requested buffer control is not available"); case DSERR_GENERIC: return _("undetermined error inside DirectSound subsystem"); -#ifdef HWUNAVAIL +#ifdef DSERR_HWUNAVAIL case DSERR_HWUNAVAIL: return _("DirectSound hardware device is unavailable"); #endif case DSERR_INVALIDCALL: return _("function is not valid for the current state of the object"); diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index 2366225c9..41771b2fb 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -20,7 +20,7 @@ * Compact Disc Digital Audio (CDDA) Input Plugin * by Mike Melanson (melanson@pcisys.net) * - * $Id: input_cdda.c,v 1.74 2005/08/25 15:36:29 valtri Exp $ + * $Id: input_cdda.c,v 1.75 2005/08/29 15:28:16 valtri Exp $ */ #ifdef HAVE_CONFIG_H @@ -32,7 +32,9 @@ #include <unistd.h> #include <sys/types.h> +#ifndef SYS_PARAM_H #include <sys/param.h> +#endif #ifdef HAVE_DIRENT_H #include <dirent.h> #endif diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am index 5b07ad1b3..4246068c0 100644 --- a/src/video_out/Makefile.am +++ b/src/video_out/Makefile.am @@ -162,7 +162,7 @@ xineplug_vo_out_stk_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ xineplug_vo_out_directx_la_SOURCES = alphablend.c yuv2rgb.c yuv2rgb_mmx.c video_out_directx.c xineplug_vo_out_directx_la_CPPFLAGS = $(DIRECTX_CPPFLAGS) -xineplug_vo_out_directx_la_LIBADD = $(DIRECTX_VIDEO_LIBS) $(XINE_LIB) +xineplug_vo_out_directx_la_LIBADD = $(DIRECTX_VIDEO_LIBS) $(XINE_LIB) $(THREAD_LIBS) xineplug_vo_out_directx_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ xineplug_vo_out_none_la_SOURCES = video_out_none.c diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c index 5827ad27c..946e3f3e4 100755 --- a/src/video_out/video_out_directx.c +++ b/src/video_out/video_out_directx.c @@ -20,7 +20,7 @@ * video_out_directx.c, direct draw video output plugin for xine * by Matthew Grooms <elon@altavista.com> * - * $Id: video_out_directx.c,v 1.22 2005/08/25 15:36:30 valtri Exp $ + * $Id: video_out_directx.c,v 1.23 2005/08/29 15:28:16 valtri Exp $ */ typedef unsigned char boolean; @@ -28,6 +28,8 @@ typedef unsigned char boolean; #include <windows.h> #include <ddraw.h> +#include <pthread.h> + #include "xine.h" #include "video_out.h" #include "alphablend.h" @@ -866,6 +868,8 @@ static vo_frame_t * win32_alloc_frame( vo_driver_t * vo_driver ) if (!win32_frame) return NULL; + pthread_mutex_init(&win32_frame->vo_frame.mutex, NULL); + win32_frame->vo_frame.proc_slice = NULL; win32_frame->vo_frame.proc_frame = NULL; win32_frame->vo_frame.field = win32_frame_field; diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index 735f41eae..b78d54af6 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -58,7 +58,7 @@ install-exec-local: cp -p $(DEF_FILE) $(DESTDIR)$(libdir) uninstall-local: - rm -f $(DEF_FILE) $(DESTDIR)$(libdir) + rm -f $(DEF_FILE) endif @INCLUDED_INTL_TRUE@@INTLLIBS@: diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 6910f157b..dfec63876 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.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: load_plugins.c,v 1.211 2005/08/25 15:36:30 valtri Exp $ + * $Id: load_plugins.c,v 1.212 2005/08/29 15:28:16 valtri Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -1088,21 +1088,21 @@ void _x_scan_plugins (xine_t *this) { if ((pluginpath = getenv("XINE_PLUGIN_PATH")) != NULL) { pluginpath = strdup(pluginpath); } else { - char *str1, *str2; + const char *str1, *str2; int len; str1 = "~/.xine/plugins"; str2 = XINE_PLUGINDIR; len = strlen(str1) + strlen(str2) + 2; pluginpath = xine_xmalloc(len); - snprintf(pluginpath, len, "%s:%s", str1, str2); + snprintf(pluginpath, len, "%s" XINE_DIRECTORY_SEPARATOR_STRING "%s", str1, str2); } plugindir = xine_xmalloc(strlen(pluginpath)+strlen(homedir)+2); j=0; lenpluginpath = strlen(pluginpath); for (i=0; i <= lenpluginpath; ++i){ switch (pluginpath[i]){ - case ':': + case XINE_DIRECTORY_SEPARATOR_CHAR: case '\0': plugindir[j] = '\0'; collect_plugins(this, plugindir); diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index c3f326bcd..c5ab40f8b 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.315 2005/08/25 15:36:30 valtri Exp $ + * $Id: xine.c,v 1.316 2005/08/29 15:28:17 valtri Exp $ */ /* @@ -1341,7 +1341,7 @@ void xine_exit (xine_t *this) { #if defined(WIN32) WSACleanup(); #endif - + free (this); } @@ -1352,7 +1352,7 @@ xine_t *xine_new (void) { #ifdef WIN32 WSADATA Data; int i_err; -#endif /* WIN32 */ +#endif this = xine_xmalloc (sizeof (xine_t)); if (!this) diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 0e05d3715..d96e8bbee 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2004 the xine project + * Copyright (C) 2000-2005 the xine project * * This file is part of xine, a free video player. * @@ -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: utils.c,v 1.39 2005/04/01 23:15:38 fsck-p Exp $ + * $Id: utils.c,v 1.40 2005/08/29 15:28:17 valtri Exp $ * */ #define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ @@ -32,9 +32,6 @@ #include "xineutils.h" #include "xineintl.h" -#ifdef _MSC_VER -#include "xine_internal.h" -#endif #include <errno.h> #include <pwd.h> @@ -55,6 +52,7 @@ #endif #if defined(__CYGWIN__) || defined(WIN32) +#include <ctype.h> #include <windows.h> #endif @@ -267,90 +265,52 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) { return ptr; } -#if defined(__CYGWIN__) || defined(WIN32) - -/* Ridiculous hack to return valid xine support - * directories. These should be read from - * a registry entry set at install time. +#ifdef WIN32 +/* + * Parse command line with Windows XP syntax and copy the command (argv[0]). */ +static size_t xine_strcpy_command(const char *cmdline, char *cmd, size_t maxlen) { + size_t i, j; + + i = 0; + j = 0; + while (cmdline[i] && isspace(cmdline[i])) i++; + + while (cmdline[i] && !isspace(cmdline[i]) && j + 2 < maxlen) { + switch (cmdline[i]) { + case '\"': + i++; + while (cmdline[i] && cmdline[i] != '\"') { + if (cmdline[i] == '\\') { + i++; + if (cmdline[i] == '\"') cmd[j++] = '\"'; + else { + cmd[j++] = '\\'; + cmd[j++] = cmdline[i]; + } + } else cmd[j++] = cmdline[i]; + if (cmdline[i]) i++; + } + break; -char *exec_path_append_subdir(char *string) { - static char tmp_win32_path[1024] = "\0"; - char *back_slash; - char *fore_slash; - char *last_slash; - - /* first run - fill out dll path */ - if (!*tmp_win32_path) { - char *tmpchar; - char *cmdline; - - /* get program exec command line */ - cmdline = GetCommandLine(); - - /* check for " at beginning of string */ - if( *cmdline == '\"' ) { - /* copy command line, skip first quote */ - strncpy(tmp_win32_path, cmdline + 1, sizeof(tmp_win32_path)); - tmp_win32_path[sizeof(tmp_win32_path) - 1] = '\0'; - - /* terminate at second set of quotes */ - tmpchar = strchr(tmp_win32_path, '\"'); - if (tmpchar) *tmpchar = 0; - } else { - /* copy command line */ - strncpy(tmp_win32_path, cmdline, sizeof(tmp_win32_path)); - tmp_win32_path[sizeof(tmp_win32_path) - 1] = '\0'; + case '\\': + i++; + if (cmdline[i] == '\"') cmd[j++] = '\"'; + else { + cmd[j++] = '\\'; + i--; + } + break; - /* terminate at first space */ - tmpchar = strchr(tmp_win32_path, ' '); - if (tmpchar) *tmpchar = 0; + default: + cmd[j++] = cmdline[i]; } - } - /* find the last occurance of a back - * slash or fore slash - */ - back_slash = strrchr(tmp_win32_path, '\\'); - fore_slash = strrchr(tmp_win32_path, '/'); - - /* make sure the last back slash was not - * after a drive letter - */ - if(back_slash > tmp_win32_path) - if(*( back_slash - 1 ) == ':') - back_slash = 0; - - /* which slash was the latter slash */ - if(back_slash > fore_slash) - last_slash = back_slash; - else - last_slash = fore_slash; - - /* detect if we had a relative or - * distiguished path ( had a slash ) - */ - if(last_slash) { - /* we had a slash charachter in our - * command line - */ - *(last_slash + 1) = 0; - - /* if had a string to append to the path */ - if(string) - strncat(tmp_win32_path, string, sizeof(tmp_win32_path) - strlen(tmp_win32_path) - 1); - } else { - if(string) { - /* if had a string to append to the path */ - strncpy(tmp_win32_path, string, sizeof(tmp_win32_path)); - tmp_win32_path[sizeof(tmp_win32_path) - 1] = '\0'; - } else { - /* no slash, assume local directory */ - strcpy(tmp_win32_path, "."); - } + i++; } + cmd[j] = '\0'; - return tmp_win32_path; + return j; } #endif @@ -359,11 +319,21 @@ char *exec_path_append_subdir(char *string) { #endif const char *xine_get_homedir(void) { - #ifdef WIN32 - return exec_path_append_subdir(NULL); -#else + static char homedir[1024] = {0, }; + char *s; + int len; + + if (!homedir[0]) { + len = xine_strcpy_command(GetCommandLine(), homedir, sizeof(homedir)); + s = strdup(homedir); + GetFullPathName(s, sizeof(homedir), homedir, NULL); + free(s); + if ((s = strrchr(homedir, '\\'))) *s = '\0'; + } + return homedir; +#else struct passwd pwd, *pw = NULL; static char homedir[BUFSIZ] = {0,}; @@ -393,9 +363,52 @@ const char *xine_get_homedir(void) { } return homedir; -#endif /* _MSC_VER */ +#endif /* WIN32 */ +} + +#if defined(WIN32) || defined(__CYGWIN__) +static void xine_get_rootdir(char *rootdir, size_t maxlen) { + char *s; + + strncpy(rootdir, xine_get_homedir(), maxlen - 1); + rootdir[maxlen - 1] = '\0'; + if ((s = strrchr(rootdir, XINE_SUBDIRECTORY_SEPARATOR_CHAR))) *s = '\0'; } +const char *xine_get_plugindir(void) { + static char plugindir[1024] = {0, }; + + if (!plugindir[0]) { + xine_get_rootdir(plugindir, sizeof(plugindir) - strlen(XINE_REL_PLUGINDIR) - 1); + strcat(plugindir, XINE_SUBDIRECTORY_SEPARATOR_STRING XINE_REL_PLUGINDIR); + } + + return plugindir; +} + +const char *xine_get_fontdir(void) { + static char fontdir[1024] = {0, }; + + if (!fontdir[0]) { + xine_get_rootdir(fontdir, sizeof(fontdir) - strlen(XINE_REL_FONTDIR) - 1); + strcat(fontdir, XINE_SUBDIRECTORY_SEPARATOR_STRING XINE_REL_FONTDIR); + } + + return fontdir; +} + +const char *xine_get_localedir(void) { + static char localedir[1024] = {0, }; + + if (!localedir[0]) { + xine_get_rootdir(localedir, sizeof(localedir) - strlen(XINE_REL_LOCALEDIR) - 1); + strcat(localedir, XINE_SUBDIRECTORY_SEPARATOR_STRING XINE_REL_LOCALEDIR); + } + + return localedir; +} +#endif + char *xine_chomp(char *str) { char *pbuf; diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 017273dd9..725c3e9e6 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.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: xineutils.h,v 1.97 2005/08/25 15:37:02 valtri Exp $ + * $Id: xineutils.h,v 1.98 2005/08/29 15:28:17 valtri Exp $ * */ #ifndef XINEUTILS_H @@ -642,6 +642,15 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base); */ const char *xine_get_homedir(void); +#if defined(WIN32) || defined(__CYGWIN__) +/* + * Get other xine directories. + */ +const char *xine_get_plugindir(void); +const char *xine_get_fontdir(void); +const char *xine_get_localedir(void); +#endif + /* * Clean a string (remove spaces and '=' at the begin, * and '\n', '\r' and spaces at the end. @@ -1035,10 +1044,6 @@ char *xine_get_system_encoding(void); */ const char *xine_guess_spu_encoding(void); -#if defined(__CYGWIN__) || defined(WIN32) -char *exec_path_append_subdir(char * string); -#endif - /* * use the best clock reference (API compatible with gettimeofday) * note: it will be a monotonic clock, if available. |