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/input/input_dvb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/input/input_dvb.c') diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 7f45d3ab8..f76207671 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -88,7 +88,9 @@ #endif #include #include +#ifdef HAVE_DIRENT_H #include +#endif #include /* These will eventually be #include */ @@ -2098,6 +2100,8 @@ static void do_record (dvb_input_plugin_t *this) { char dates[64]; int x=0; xine_cfg_entry_t savedir; + DIR *dir; + if (this->record_fd > -1) { /* stop recording */ @@ -2120,10 +2124,11 @@ static void do_record (dvb_input_plugin_t *this) { if (xine_config_lookup_entry(this->stream->xine, "media.capture.save_dir", &savedir)){ if(strlen(savedir.str_value)>1){ - if(opendir(savedir.str_value)==NULL){ + if((dir = opendir(savedir.str_value))==NULL){ snprintf (filename, 256, "%s/%s_%s.ts",xine_get_homedir(),this->channels[this->channel].name, dates); xprintf(this->class->xine,XINE_VERBOSITY_LOG,"savedir is wrong... saving to home directory\n"); } else { + closedir(dir); snprintf (filename, 256, "%s/%s_%s.ts",savedir.str_value,this->channels[this->channel].name, dates); xprintf(this->class->xine,XINE_VERBOSITY_LOG,"saving to savedir\n"); } -- cgit v1.2.3