summaryrefslogtreecommitdiff
path: root/src/xine-engine/load_plugins.c
diff options
context:
space:
mode:
authorFrantišek Dvořák <valtri@users.sourceforge.net>2005-08-25 15:36:29 +0000
committerFrantišek Dvořák <valtri@users.sourceforge.net>2005-08-25 15:36:29 +0000
commitf45651f26bc3aa1b312d282c5d8c4b04be0c2505 (patch)
tree7ff95ed1ee104e776559c7885539e1ff7a39fe97 /src/xine-engine/load_plugins.c
parent21c4975cc49bbbeac0067aa0847b3604ea639676 (diff)
downloadxine-lib-f45651f26bc3aa1b312d282c5d8c4b04be0c2505.tar.gz
xine-lib-f45651f26bc3aa1b312d282c5d8c4b04be0c2505.tar.bz2
*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
Diffstat (limited to 'src/xine-engine/load_plugins.c')
-rw-r--r--src/xine-engine/load_plugins.c13
1 files changed, 8 insertions, 5 deletions
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 <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#ifdef HAVE_DIRENT_H
#include <dirent.h>
+#endif
#include <dlfcn.h>
#include <string.h>
#include <errno.h>
@@ -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);