Mercurial > mplayer.hg
diff mplayer.c @ 9831:0397b461f0fb
MINGW32 port and select()less fifocode by Arpi
author | faust3 |
---|---|
date | Fri, 04 Apr 2003 20:02:53 +0000 |
parents | 3db72324a0fe |
children | 09d630a4f991 |
line wrap: on
line diff
--- a/mplayer.c Fri Apr 04 19:33:18 2003 +0000 +++ b/mplayer.c Fri Apr 04 20:02:53 2003 +0000 @@ -5,10 +5,18 @@ #include <string.h> #include <unistd.h> -#include <sys/ioctl.h> // #include <sys/mman.h> #include <sys/types.h> +#ifndef __MINGW32__ +#include <sys/ioctl.h> #include <sys/wait.h> +#else +#define SIGHUP 1 /* hangup */ +#define SIGQUIT 3 /* quit */ +#define SIGKILL 9 /* kill (cannot be caught or ignored) */ +#define SIGBUS 10 /* bus error */ +#endif + #include <sys/time.h> #include <sys/stat.h> @@ -465,7 +473,9 @@ if(sig_count==5 || (inited_flags==0 && sig_count>1)) exit(1); if(sig_count>5){ // can't stop :( +#ifndef __MINGW32__ kill(getpid(),SIGKILL); +#endif } mp_msg(MSGT_CPLAYER,MSGL_FATAL,"\n" MSGTR_IntBySignal,x, current_module?current_module:mp_gettext("unknown") @@ -508,7 +518,11 @@ if ((conffile = get_path("")) == NULL) { mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_NoHomeDir); } else { +#ifdef __MINGW32__ + mkdir(conffile); +#else mkdir(conffile, 0777); +#endif free(conffile); if ((conffile = get_path("config")) == NULL) { mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_GetpathProblem); @@ -1005,17 +1019,27 @@ #endif // ========== Init keyboard FIFO (connection to libvo) ============ -make_pipe(&keyb_fifo_get,&keyb_fifo_put); // Init input system current_module = "init_input"; mp_input_init(); +#ifndef HAVE_NO_POSIX_SELECT +make_pipe(&keyb_fifo_get,&keyb_fifo_put); + if(keyb_fifo_get > 0) mp_input_add_key_fd(keyb_fifo_get,1,NULL,NULL); +#else + mp_input_add_key_fd(-1,0,mplayer_get_key,NULL); +#endif if(slave_mode) mp_input_add_cmd_fd(0,1,NULL,NULL); else if(!use_stdin) +#ifndef HAVE_NO_POSIX_SELECT mp_input_add_key_fd(0,1,NULL,NULL); +#else + mp_input_add_key_fd(0,0,NULL,NULL); +#endif + inited_flags|=INITED_INPUT; current_module = NULL; @@ -3238,11 +3262,13 @@ } #endif +#ifdef HAVE_X11 if (stop_xscreensaver && sh_video) { current_module="stop_xscreensaver"; xscreensaver_heartbeat(sh_video->pts); current_module=NULL; } +#endif // DVD sub: if(vo_config_count && vo_spudec) {