- 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::setGameVersion(glestVersionString);
/*
#if defined(WIN32)
printf("Path [%s]\n",executable_path(argv[0]).c_str());
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false &&
@ -2848,19 +2849,18 @@ int glestMain(int argc, char** argv) {
fclose(stdout);
fclose(stderr);
/*
int myin = _dup(_fileno(stdin));
int myout = _dup(_fileno(stdout));
int myerr = _dup(_fileno(stderr));
// int myin = _dup(_fileno(stdin));
// int myout = _dup(_fileno(stdout));
// int myerr = _dup(_fileno(stderr));
fclose(stdin);
fclose(stdout);
fclose(stderr);
// fclose(stdin);
// fclose(stdout);
// 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_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"));
}
#endif
*/
ServerSocket::setMaxPlayerCount(GameConstants::maxPlayers);

View File

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