diff --git a/source/glest_game/main/intro.cpp b/source/glest_game/main/intro.cpp index 6d99c2ad..8aaaa255 100644 --- a/source/glest_game/main/intro.cpp +++ b/source/glest_game/main/intro.cpp @@ -499,8 +499,14 @@ Intro::Intro(Program *program): Context *c= GraphicsInterface::getInstance().getCurrentContext(); SDL_Surface *screen = static_cast(c)->getPlatformContextGlPtr()->getScreen(); + string vlcPluginsPath = Config::getInstance().getString("VideoPlayerPluginsPath",""); //printf("screen->w = %d screen->h = %d screen->format->BitsPerPixel = %d\n",screen->w,screen->h,screen->format->BitsPerPixel); - VideoPlayer player(introVideoFile.c_str(),screen,screen->w,screen->h,screen->format->BitsPerPixel); + VideoPlayer player(introVideoFile.c_str(), + screen, + screen->w, + screen->h, + screen->format->BitsPerPixel, + vlcPluginsPath); player.PlayVideo(); return; } diff --git a/source/shared_lib/include/graphics/video_player.h b/source/shared_lib/include/graphics/video_player.h index a10c1010..eba91e73 100644 --- a/source/shared_lib/include/graphics/video_player.h +++ b/source/shared_lib/include/graphics/video_player.h @@ -25,10 +25,13 @@ protected: int width; int height; int colorBits; + string pluginsPath; + bool stop; public: - VideoPlayer(string filename, SDL_Surface *surface, int width, int height,int colorBits); + VideoPlayer(string filename, SDL_Surface *surface, int width, int height, + int colorBits, string pluginsPath); virtual ~VideoPlayer(); void PlayVideo(); diff --git a/source/shared_lib/sources/graphics/video_player.cpp b/source/shared_lib/sources/graphics/video_player.cpp index b8f92ce8..16638a31 100644 --- a/source/shared_lib/sources/graphics/video_player.cpp +++ b/source/shared_lib/sources/graphics/video_player.cpp @@ -74,12 +74,13 @@ static void display(void *data, void *id) { } VideoPlayer::VideoPlayer(string filename, SDL_Surface *surface, - int width, int height,int colorBits) { + int width, int height,int colorBits,string pluginsPath) { this->filename = filename; this->surface = surface; this->width = width; this->height = height; this->colorBits = colorBits; + this->pluginsPath = pluginsPath; this->stop = false; } @@ -99,11 +100,18 @@ void VideoPlayer::PlayVideo() { libvlc_instance_t *libvlc = NULL; libvlc_media_t *m = NULL; libvlc_media_player_t *mp = NULL; + + string pluginParam = ""; + if(pluginsPath != "") { + pluginParam = "--plugin-path=" + pluginsPath; + } + char const *vlc_argv[] = { //"--no-audio", /* skip any audio track */ "--no-xlib", /* tell VLC to not use Xlib */ "--no-video-title-show", + pluginParam.c_str(), }; int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); #endif