[vlc-commits] activex/npapi: fix attribute 'mute' (refs #14767)

Daniel Amm git at videolan.org
Mon Dec 7 16:50:40 CET 2015


npapi-vlc | branch: master | Daniel Amm <da2424 at t-online.de> | Fri May 29 15:16:31 2015 +0200| [21b673f8409ee279ca1a3e4c65e3837d2ea44a7e] | committer: Jean-Baptiste Kempf

activex/npapi: fix attribute 'mute' (refs #14767)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> https://code.videolan.org/videolan/npapi-vlc/commit/21b673f8409ee279ca1a3e4c65e3837d2ea44a7e
---

 activex/plugin.cpp       |  9 +++++++++
 activex/plugin.h         |  2 +-
 npapi/vlcplugin_base.cpp | 13 +++++++------
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/activex/plugin.cpp b/activex/plugin.cpp
index 9d59da2..096abbb 100644
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -766,6 +766,15 @@ void VLCPlugin::setTime(int seconds)
     }
 }
 
+void VLCPlugin::setMute(BOOL mute)
+{
+    if( mute != _b_mute )
+    {
+        _b_mute = mute;
+        m_player.get_mp().setMute( _b_mute );
+    }
+}
+
 void VLCPlugin::setFocus(BOOL fFocus)
 {
     if( fFocus )
diff --git a/activex/plugin.h b/activex/plugin.h
index 1f2dbd6..97f5e73 100644
--- a/activex/plugin.h
+++ b/activex/plugin.h
@@ -175,7 +175,7 @@ public:
     const SIZEL& getExtent(void) { return _extent; };
 
     // transient properties
-    inline void setMute(BOOL mute) { _b_mute = mute; };
+    void setMute(BOOL mute);
 
     inline void setPicture(LPPICTURE pict)
     {
diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index cd28998..bfefdbf 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -123,6 +123,7 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
     ppsz_argv[ppsz_argc++] = "--no-xlib";
 
     bool b_autoloop = false;
+    bool b_mute = false;
 
     /* parse plugin arguments */
     for( int i = 0; (i < argc) && (ppsz_argc < MAX_PARAMS); i++ )
@@ -143,7 +144,7 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
         else if( !strcmp( argn[i], "autoplay")
               || !strcmp( argn[i], "autostart") )
         {
-            set_autoplay(boolValue(argv[i]));
+            set_autoplay( boolValue(argv[i]) );
         }
         else if( !strcmp( argn[i], "fullscreen" )
               || !strcmp( argn[i], "allowfullscreen" )
@@ -153,10 +154,7 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
         }
         else if( !strcmp( argn[i], "mute" ) )
         {
-            if( boolValue(argv[i]) )
-            {
-                ppsz_argv[ppsz_argc++] = "--volume=0";
-            }
+            b_mute = boolValue( argv[i] );
         }
         else if( !strcmp( argn[i], "loop")
               || !strcmp( argn[i], "autoloop") )
@@ -187,7 +185,10 @@ NPError VlcPluginBase::init(int argc, char* const argn[], char* const argv[])
     }
 
     m_player.mlp().setPlaybackMode( b_autoloop ? libvlc_playback_mode_loop :
-                                      libvlc_playback_mode_default);
+                                      libvlc_playback_mode_default );
+
+    if( b_mute )
+        m_player.get_mp().setMute( true );
 
     /*
     ** fetch plugin base URL, which is the URL of the page containing the plugin



More information about the vlc-commits mailing list