*** smpeg-xmms.c.orig Sun Oct 8 22:53:25 2000 --- smpeg-xmms.c Mon Oct 9 00:06:30 2000 *************** *** 37,43 **** --- 37,45 ---- #include #include #include + #ifdef __linux #include + #endif static InputPlugin smpeg_ip; *************** *** 53,60 **** --- 55,67 ---- static gboolean fullscreen = FALSE; static gboolean is_vcd = FALSE; static gboolean rstop = FALSE; + + static gint vol; + + #ifdef __linux static gint vol, vcd_pipe[2], vcd_fd; struct cdrom_tocentry vcd_toc; + #endif static gint smpeg_is_our_file(gchar * filename); static void smpeg_play_file(gchar * filename); *************** *** 469,474 **** --- 476,483 ---- SDL_mutexV(mpeg_mutex); } + #ifdef __linux + static int vcd_read(gint fd, gint lba, guchar *buf) { struct cdrom_msf *msf; *************** *** 481,486 **** --- 490,499 ---- return ioctl(fd, CDROMREADMODE2, buf); } + #endif + + #ifdef __linux + static void smpeg_read_vcd_func(void) { gint pos; *************** *** 502,507 **** --- 515,522 ---- g_free(buffer); } + #endif + static void smpeg_play_file(gchar * filename) { SMPEG_Info info; *************** *** 532,538 **** return; } } ! vcd_fd = open(filename + 4, O_RDONLY, 0); if(vcd_fd < 0) { --- 547,553 ---- return; } } ! #ifdef __linux vcd_fd = open(filename + 4, O_RDONLY, 0); if(vcd_fd < 0) { *************** *** 555,560 **** --- 570,576 ---- } vcd_thread = SDL_CreateThread((void *)smpeg_read_vcd_func, NULL); mpeg = SMPEG_new_descr(vcd_pipe[0], &info, TRUE); + #endif } else { *************** *** 582,588 **** --- 598,608 ---- if (smpeg_cfg.center_mode) putenv("SDL_VIDEO_CENTERED=1"); else + #ifdef __linux unsetenv("SDL_VIDEO_CENTERED"); + #else + putenv("SDL_VIDEO_CENTERED=0"); + #endif if (smpeg_cfg.states_mode && smpeg_cfg.windowsize_mode) { gint wg = 0, hg = 0; *************** *** 667,673 **** --- 687,697 ---- smpeg_ip.set_info(name, info.total_time * 1000, bitrate * 1000, srate, nch); g_free(name); + #ifdef __linux unsetenv("SDL_VIDEO_CENTERED"); + #else + putenv("SDL_VIDEO_CENTERED=0"); + #endif playing = TRUE; fullscreen = smpeg_cfg.fullscreen_mode; doublesize = smpeg_cfg.double_mode; *************** *** 724,735 **** --- 748,761 ---- SDL_KillThread(thread); SMPEG_stop(mpeg); SMPEG_delete(mpeg); + #ifdef __linux if(is_vcd) { close(vcd_pipe[0]); close(vcd_pipe[1]); close(vcd_fd); } + #endif SDL_mutexV(mpeg_mutex); SDL_DestroyMutex(mpeg_mutex); SDL_FreeSurface(screen);