- added new ini setting to explicitly set the vlc plugins folder:

VideoPlayerPluginsPath=c:\program files\videolan\plugins
This commit is contained in:
Mark Vejvoda 2012-05-12 22:48:29 +00:00
parent ede0a63def
commit af508a1a59
3 changed files with 20 additions and 3 deletions

View File

@ -499,8 +499,14 @@ Intro::Intro(Program *program):
Context *c= GraphicsInterface::getInstance().getCurrentContext();
SDL_Surface *screen = static_cast<ContextGl*>(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;
}

View File

@ -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();

View File

@ -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