- fixed libvlc on windows (timing problem when loading videos)

- commented out retarded environment variable code since we just ship the plugins folder now
This commit is contained in:
Mark Vejvoda
2012-05-19 02:47:53 +00:00
parent 1ffc0a3fc4
commit 3187252936
2 changed files with 17 additions and 14 deletions

View File

@@ -2775,6 +2775,7 @@ int glestMain(int argc, char** argv) {
Properties::setApplicationPath(executable_path(argv[0])); Properties::setApplicationPath(executable_path(argv[0]));
Properties::setGameVersion(glestVersionString); Properties::setGameVersion(glestVersionString);
/*
#if defined(WIN32) #if defined(WIN32)
printf("Path [%s]\n",executable_path(argv[0]).c_str()); printf("Path [%s]\n",executable_path(argv[0]).c_str());
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false && if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
@@ -2848,19 +2849,18 @@ int glestMain(int argc, char** argv) {
fclose(stdout); fclose(stdout);
fclose(stderr); fclose(stderr);
/* // int myin = _dup(_fileno(stdin));
int myin = _dup(_fileno(stdin)); // int myout = _dup(_fileno(stdout));
int myout = _dup(_fileno(stdout)); // int myerr = _dup(_fileno(stderr));
int myerr = _dup(_fileno(stderr));
fclose(stdin); // fclose(stdin);
fclose(stdout); // fclose(stdout);
fclose(stderr); // fclose(stderr);
// _dup2(myin,0);
// _dup2(myout,1);
// _dup2(myerr,2);
_dup2(myin,0);
_dup2(myout,1);
_dup2(myerr,2);
*/
//fcntl(fd, F_SETFD, FD_CLOEXEC); //fcntl(fd, F_SETFD, FD_CLOEXEC);
//fcntl(fd, F_SETFL, fcntl(fd, F_GETFD) | FD_CLOEXEC)); //fcntl(fd, F_SETFL, fcntl(fd, F_GETFD) | FD_CLOEXEC));
@@ -2879,6 +2879,7 @@ int glestMain(int argc, char** argv) {
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("*** VLC E [%s]\n",getenv("VLC_PLUGIN_PATH")); if(SystemFlags::VERBOSE_MODE_ENABLED) printf("*** VLC E [%s]\n",getenv("VLC_PLUGIN_PATH"));
} }
#endif #endif
*/
ServerSocket::setMaxPlayerCount(GameConstants::maxPlayers); ServerSocket::setMaxPlayerCount(GameConstants::maxPlayers);

View File

@@ -189,6 +189,7 @@ bool VideoPlayer::hasBackEndVideoPlayer() {
return false; return false;
} }
void VideoPlayer::PlayVideo() { void VideoPlayer::PlayVideo() {
//verboseEnabled = true;
struct ctx ctx; struct ctx ctx;
ctx.width = width; ctx.width = width;
ctx.height = height; ctx.height = height;
@@ -206,8 +207,7 @@ void VideoPlayer::PlayVideo() {
// } // }
std::vector<const char *> vlc_argv; std::vector<const char *> vlc_argv;
vlc_argv.push_back("-I"); vlc_argv.push_back("--intf=dummy");
vlc_argv.push_back("dummy"); /* Don't use any interface */
vlc_argv.push_back("--no-media-library"); vlc_argv.push_back("--no-media-library");
vlc_argv.push_back("--ignore-config"); /* Don't use VLC's config */ vlc_argv.push_back("--ignore-config"); /* Don't use VLC's config */
vlc_argv.push_back("--no-xlib"); /* tell VLC to not use Xlib */ vlc_argv.push_back("--no-xlib"); /* tell VLC to not use Xlib */
@@ -391,15 +391,17 @@ void VideoPlayer::PlayVideo() {
} }
#endif #endif
ctx.isPlaying = true;
#if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13) #if defined(LIBVLC_VERSION_PRE_2) && defined(LIBVLC_VERSION_PRE_1_1_13)
int play_result = libvlc_media_player_play(mp,&ex); int play_result = libvlc_media_player_play(mp,&ex);
#else #else
int play_result = libvlc_media_player_play(mp); int play_result = libvlc_media_player_play(mp);
#endif #endif
//SDL_Delay(5);
if(verboseEnabled) printf("In [%s] Line: %d, play_result [%d]\n",__FUNCTION__,__LINE__,play_result); if(verboseEnabled) printf("In [%s] Line: %d, play_result [%d]\n",__FUNCTION__,__LINE__,play_result);
successLoadingVLC = true; successLoadingVLC = (play_result == 0);
} }
#endif #endif