- 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(); Context *c= GraphicsInterface::getInstance().getCurrentContext();
SDL_Surface *screen = static_cast<ContextGl*>(c)->getPlatformContextGlPtr()->getScreen(); 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); //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(); player.PlayVideo();
return; return;
} }

View File

@ -25,10 +25,13 @@ protected:
int width; int width;
int height; int height;
int colorBits; int colorBits;
string pluginsPath;
bool stop; bool stop;
public: 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(); virtual ~VideoPlayer();
void PlayVideo(); void PlayVideo();

View File

@ -74,12 +74,13 @@ static void display(void *data, void *id) {
} }
VideoPlayer::VideoPlayer(string filename, SDL_Surface *surface, 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->filename = filename;
this->surface = surface; this->surface = surface;
this->width = width; this->width = width;
this->height = height; this->height = height;
this->colorBits = colorBits; this->colorBits = colorBits;
this->pluginsPath = pluginsPath;
this->stop = false; this->stop = false;
} }
@ -99,11 +100,18 @@ void VideoPlayer::PlayVideo() {
libvlc_instance_t *libvlc = NULL; libvlc_instance_t *libvlc = NULL;
libvlc_media_t *m = NULL; libvlc_media_t *m = NULL;
libvlc_media_player_t *mp = NULL; libvlc_media_player_t *mp = NULL;
string pluginParam = "";
if(pluginsPath != "") {
pluginParam = "--plugin-path=" + pluginsPath;
}
char const *vlc_argv[] = char const *vlc_argv[] =
{ {
//"--no-audio", /* skip any audio track */ //"--no-audio", /* skip any audio track */
"--no-xlib", /* tell VLC to not use Xlib */ "--no-xlib", /* tell VLC to not use Xlib */
"--no-video-title-show", "--no-video-title-show",
pluginParam.c_str(),
}; };
int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv);
#endif #endif