[vlc-devel] [PATCH] npapi: added playback mode processing
Sergey Radionov
rsatom at gmail.com
Sat Apr 21 18:17:05 CEST 2012
---
npapi/vlcplugin_base.cpp | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index 3941a76..cbe866c 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -435,6 +435,8 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
ppsz_argv[ppsz_argc++] = "--no-video-title-show";
ppsz_argv[ppsz_argc++] = "--no-xlib";
+ bool b_autoloop = false;
+
/* parse plugin arguments */
for( int i = 0; (i < argc) && (ppsz_argc < 32); i++ )
{
@@ -471,14 +473,7 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
else if( !strcmp( argn[i], "loop")
|| !strcmp( argn[i], "autoloop") )
{
- if( boolValue(argv[i]) )
- {
- ppsz_argv[ppsz_argc++] = "--loop";
- }
- else
- {
- ppsz_argv[ppsz_argc++] = "--no-loop";
- }
+ b_autoloop = boolValue(argv[i]);
}
else if( !strcmp( argn[i], "toolbar" ) )
{
@@ -496,6 +491,9 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
vlc_player::open(libvlc_instance);
+ vlc_player::set_mode(b_autoloop ? libvlc_playback_mode_loop :
+ libvlc_playback_mode_default);
+
/*
** fetch plugin base URL, which is the URL of the page containing the plugin
** this URL is used for making absolute URL from relative URL that may be
--
1.7.7.1.msysgit.0
More information about the vlc-devel
mailing list