[vlc-devel] [PATCH 1/2] activex: allow empty strings (fixes #14838)

Daniel Amm da2424 at t-online.de
Tue Oct 11 19:30:59 CEST 2016


---
 activex/vlccontrol2.cpp | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/activex/vlccontrol2.cpp b/activex/vlccontrol2.cpp
index 90a8d46..6e50ce2 100644
--- 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 )
-- 
2.10.1.windows.1



More information about the vlc-devel mailing list