Index: mplayer.c =================================================================== --- mplayer.c (revision 24089) +++ mplayer.c (working copy) @@ -10,6 +10,12 @@ #define _UWIN 1 /*disable Non-underscored versions of non-ANSI functions as otherwise int eof would conflict with eof()*/ #include #endif + +#ifdef __OS2__ +#define INCL_DOS +#include +#endif + #include #include @@ -2277,6 +2283,22 @@ return 0; } +#ifdef __OS2__ +extern int _fmode_bin; + +// Change process type from VIO to PM to use PM APIs. +void MorphToPM() +{ + PPIB pib; + PTIB tib; + + DosGetInfoBlocks(&tib, &pib); + + // Change flag from VIO to PM: + if (pib->pib_ultype==2) pib->pib_ultype = 3; +} +#endif + int main(int argc,char* argv[]){ @@ -2293,6 +2315,14 @@ int gui_no_filename=0; +#ifdef __OS2__ + _fmode_bin = 1; // to make binary mode default + + _envargs( &argc, &argv, "MPLAYER_OPTIONS" ); + + MorphToPM(); +#endif + srand((int) time(NULL)); InitTimer(); @@ -2597,10 +2627,12 @@ mp_input_init(use_gui); mp_input_add_key_fd(-1,0,mplayer_get_key,NULL); if(slave_mode) -#ifndef __MINGW32__ +#ifdef __MINGW32__ + mp_input_add_cmd_fd(0,0,mp_input_win32_slave_cmd_func,NULL); +#elif defined(__OS2__) + mp_input_add_cmd_fd(0,0,mp_input_os2_slave_cmd_func,NULL); +#else mp_input_add_cmd_fd(0,1,NULL,NULL); -#else - mp_input_add_cmd_fd(0,0,mp_input_win32_slave_cmd_func,NULL); #endif else if(!noconsolecontrols) mp_input_add_key_fd(0,1,NULL,NULL);