[vlc-commits] [Git][videolan/npapi-vlc][master] 2 commits: activex: allow empty strings (fixes #14838)

Jean-Baptiste Kempf gitlab at videolan.org
Thu Oct 13 11:15:55 CEST 2016


Jean-Baptiste Kempf pushed to branch master at videolan / VLC Browser Plugins


Commits:
f8e1e6f7 by Daniel Amm at 2016-10-13T11:15:37+02:00
activex: allow empty strings (fixes #14838)

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

- - - - -
2e544b26 by Daniel Amm at 2016-10-13T11:15:39+02:00
activex: fix initial volume value

_i_volume is used to set a custom initial volume over the html embed
attribute or the Visual Studio object property window.
A new value will be only accepted if it's different to _i_volume. So if
you want to set it to 50, it will currently not work, because activex
initializes libvlc with 100 (default).

This patch will set _i_volume to 100 to match the real volume.

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

- - - - -


2 changed files:

- activex/plugin.cpp
- activex/vlccontrol2.cpp


Changes:

=====================================
activex/plugin.cpp
=====================================
--- a/activex/plugin.cpp
+++ b/activex/plugin.cpp
@@ -386,7 +386,7 @@ HRESULT VLCPlugin::onInit(void)
     _bstr_mrl     = NULL;
     _b_visible    = TRUE;
     _b_mute       = FALSE;
-    _i_volume     = 50;
+    _i_volume     = 100;
     _i_time       = 0;
     _i_backcolor  = 0;
     // set default/preferred size (320x240) pixels in HIMETRIC


=====================================
activex/vlccontrol2.cpp
=====================================
--- a/activex/vlccontrol2.cpp
+++ b/activex/vlccontrol2.cpp
@@ -1093,8 +1093,11 @@ STDMETHODIMP VLCVideo::get_aspectRatio(BSTR* aspect)
 
 STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
 {
-    if( NULL == aspect )
-        return E_POINTER;
+    if( 0 == SysStringLen(aspect) )
+    {
+        _plug->get_player().get_mp().setAspectRatio( "" );
+        return S_OK;
+    }
 
     char *psz_aspect = CStrFromBSTR(CP_UTF8, aspect);
     if( !psz_aspect )
@@ -1136,11 +1139,11 @@ STDMETHODIMP VLCVideo::get_crop(BSTR* geometry)
 
 STDMETHODIMP VLCVideo::put_crop(BSTR geometry)
 {
-    if( NULL == geometry )
-        return E_POINTER;
-
     if( 0 == SysStringLen(geometry) )
-        return E_INVALIDARG;
+    {
+        _plug->get_player().get_mp().setCropGeometry( "" );
+        return S_OK;
+    }
 
     char *psz_geometry = CStrFromBSTR(CP_UTF8, geometry);
     if( !psz_geometry )



View it on GitLab: https://code.videolan.org/videolan/npapi-vlc/compare/fcd99cef812cbe0ec0218a48c3f6d9d89be2b348...2e544b26bcea8671afe78af21aa9f3188a69b2b1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-commits/attachments/20161013/7048563c/attachment-0001.html>


More information about the vlc-commits mailing list