From f45651f26bc3aa1b312d282c5d8c4b04be0c2505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 25 Aug 2005 15:36:29 +0000 Subject: *BUGFIX* Windows ports fixes and improvements due to my current work on toxine: - first experiments with external win32 pthreads, more portable code (pthread_t may be a struct) - headers refactored - moved dirent win32 replacement to lib/, hide it for frontends, used system version, if found, not used non-POSIX dirent->d_reclen (this item doesn't work in MinGW), fix memleak in dvb - separated settings for postproc and avcodec when using external ffmpeg - check for malloc.h in public xine.m4, used it conditionally in xine headers - replaced random() by POSIX more common rand() - prevent one segfault in directx vo plugin, if fails - M$VC port update CVS patchset: 7709 CVS date: 2005/08/25 15:36:29 --- src/xine-engine/load_plugins.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/xine-engine/load_plugins.c') diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index eceacb799..6910f157b 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.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: load_plugins.c,v 1.210 2005/07/18 01:46:02 miguelfreitas Exp $ + * $Id: load_plugins.c,v 1.211 2005/08/25 15:36:30 valtri Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -32,7 +32,9 @@ #include #include #include +#ifdef HAVE_DIRENT_H #include +#endif #include #include #include @@ -536,19 +538,20 @@ static void collect_plugins(xine_t *this, char *path){ str[path_len + 1] = '\0'; while ((pEntry = readdir (dir)) != NULL) { - size_t new_str_size; + size_t new_str_size, d_len; void *lib = NULL; plugin_info_t *info = NULL; struct stat statbuffer; - new_str_size = path_len + pEntry->d_reclen + 2; + d_len = strlen(pEntry->d_name); + new_str_size = path_len + d_len + 2; if (str_size < new_str_size) { str_size = new_str_size + new_str_size / 2; str = realloc(str, str_size); } - xine_fast_memcpy(&str[path_len + 1], pEntry->d_name, pEntry->d_reclen + 1); + xine_fast_memcpy(&str[path_len + 1], pEntry->d_name, d_len + 1); if (stat(str, &statbuffer)) { xine_log (this, XINE_LOG_PLUGIN, _("load_plugins: unable to stat %s\n"), str); -- cgit v1.2.3