]> git.sesse.net Git - vlc/commitdiff
Fix property get_aspectRatio (forward port of [17383])
authorJean-Paul Saman <jpsaman@videolan.org>
Mon, 30 Oct 2006 19:21:06 +0000 (19:21 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Mon, 30 Oct 2006 19:21:06 +0000 (19:21 +0000)
activex/axvlc.idl
activex/axvlc_idl.h
activex/vlccontrol2.cpp
activex/vlccontrol2.h

index 0cd7992318b0333f948590a6b5db5dc9533a1c05..b946e6e9c0e59765d9cbbe0b79a91395cb39f1f0 100644 (file)
@@ -403,7 +403,7 @@ library AXVLC
         HRESULT height([out, retval] long* height);\r
 \r
         [propget, helpstring("Returns video aspect ratio.")]\r
-        HRESULT aspectRatio([out, retval] BSTR *aspect);\r
+        HRESULT aspectRatio([out, retval] BSTR aspect);\r
         [propput, helpstring("Sets video aspect ratio.")]\r
         HRESULT aspectRatio([in] BSTR aspect);\r
 \r
index ec703cca53cfa8e78d0399a51f233b141de7cddb..6b779a45dd60a6455808d0238d611b22da63e774 100644 (file)
@@ -2035,7 +2035,7 @@ interface IVLCVideo : public IDispatch
         long* height) = 0;
 
     virtual HRESULT STDMETHODCALLTYPE get_aspectRatio(
-        BSTR* aspect) = 0;
+        BSTR aspect) = 0;
 
     virtual HRESULT STDMETHODCALLTYPE put_aspectRatio(
         BSTR aspect) = 0;
@@ -2109,7 +2109,7 @@ typedef struct IVLCVideoVtbl {
 
     HRESULT (STDMETHODCALLTYPE *get_aspectRatio)(
         IVLCVideo* This,
-        BSTR* aspect);
+        BSTR aspect);
 
     HRESULT (STDMETHODCALLTYPE *put_aspectRatio)(
         IVLCVideo* This,
@@ -2180,7 +2180,7 @@ void __RPC_STUB IVLCVideo_get_height_Stub(
     DWORD* pdwStubPhase);
 HRESULT CALLBACK IVLCVideo_get_aspectRatio_Proxy(
     IVLCVideo* This,
-    BSTR* aspect);
+    BSTR aspect);
 void __RPC_STUB IVLCVideo_get_aspectRatio_Stub(
     IRpcStubBuffer* This,
     IRpcChannelBuffer* pRpcChannelBuffer,
index 7c1b8ed48376d4a1a4dea3f6eb1b6b137b178054..cf27691b36365c8b45edcf1c02f9057a46a0dcd4 100755 (executable)
@@ -1758,9 +1758,9 @@ STDMETHODIMP VLCVideo::get_height(long* height)
     return hr;
 };
 
-STDMETHODIMP VLCVideo::get_aspectRatio(BSTR *aspect)
+STDMETHODIMP VLCVideo::get_aspectRatio(BSTR aspect)
 {
-    if( NULL == *aspect )
+    if( NULL == aspect )
         return E_POINTER;
 
     libvlc_instance_t* p_libvlc;
@@ -1775,19 +1775,16 @@ STDMETHODIMP VLCVideo::get_aspectRatio(BSTR *aspect)
         {
             char *psz_aspect = libvlc_video_get_aspect_ratio(p_input, &ex);
 
-            if( !psz_aspect )
+            libvlc_input_free(p_input);
+            if( NULL == psz_aspect )
                 return E_OUTOFMEMORY;
 
             if( ! libvlc_exception_raised(&ex) )
             {
-                *aspect = SysAllocStringByteLen(psz_aspect, strlen(psz_aspect));
+                aspect = SysAllocStringByteLen(psz_aspect, strlen(psz_aspect));
                 free( psz_aspect );
                 psz_aspect = NULL;
-                libvlc_input_free(p_input);
-                if( ! libvlc_exception_raised(&ex) )
-                {
-                    return NOERROR;
-                }
+                return NOERROR;
            }
            if( psz_aspect ) free( psz_aspect );
         }
index 380a38cf99bca7a33abc7adc667b344caf9c573b..f2ba69a541a0c93389862754d1aa2b1b8bb3286b 100755 (executable)
@@ -460,7 +460,7 @@ public:
     STDMETHODIMP put_fullscreen(VARIANT_BOOL);
     STDMETHODIMP get_width(long*);
     STDMETHODIMP get_height(long*);
-    STDMETHODIMP get_aspectRatio(BSTR*);
+    STDMETHODIMP get_aspectRatio(BSTR);
     STDMETHODIMP put_aspectRatio(BSTR);
     STDMETHODIMP toggleFullscreen();