Commit 043ddf12 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Fix property get_aspectRatio (forward port of [17383])

parent a3995514
...@@ -403,7 +403,7 @@ library AXVLC ...@@ -403,7 +403,7 @@ library AXVLC
HRESULT height([out, retval] long* height); HRESULT height([out, retval] long* height);
[propget, helpstring("Returns video aspect ratio.")] [propget, helpstring("Returns video aspect ratio.")]
HRESULT aspectRatio([out, retval] BSTR *aspect); HRESULT aspectRatio([out, retval] BSTR aspect);
[propput, helpstring("Sets video aspect ratio.")] [propput, helpstring("Sets video aspect ratio.")]
HRESULT aspectRatio([in] BSTR aspect); HRESULT aspectRatio([in] BSTR aspect);
......
...@@ -2035,7 +2035,7 @@ interface IVLCVideo : public IDispatch ...@@ -2035,7 +2035,7 @@ interface IVLCVideo : public IDispatch
long* height) = 0; long* height) = 0;
virtual HRESULT STDMETHODCALLTYPE get_aspectRatio( virtual HRESULT STDMETHODCALLTYPE get_aspectRatio(
BSTR* aspect) = 0; BSTR aspect) = 0;
virtual HRESULT STDMETHODCALLTYPE put_aspectRatio( virtual HRESULT STDMETHODCALLTYPE put_aspectRatio(
BSTR aspect) = 0; BSTR aspect) = 0;
...@@ -2109,7 +2109,7 @@ typedef struct IVLCVideoVtbl { ...@@ -2109,7 +2109,7 @@ typedef struct IVLCVideoVtbl {
HRESULT (STDMETHODCALLTYPE *get_aspectRatio)( HRESULT (STDMETHODCALLTYPE *get_aspectRatio)(
IVLCVideo* This, IVLCVideo* This,
BSTR* aspect); BSTR aspect);
HRESULT (STDMETHODCALLTYPE *put_aspectRatio)( HRESULT (STDMETHODCALLTYPE *put_aspectRatio)(
IVLCVideo* This, IVLCVideo* This,
...@@ -2180,7 +2180,7 @@ void __RPC_STUB IVLCVideo_get_height_Stub( ...@@ -2180,7 +2180,7 @@ void __RPC_STUB IVLCVideo_get_height_Stub(
DWORD* pdwStubPhase); DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCVideo_get_aspectRatio_Proxy( HRESULT CALLBACK IVLCVideo_get_aspectRatio_Proxy(
IVLCVideo* This, IVLCVideo* This,
BSTR* aspect); BSTR aspect);
void __RPC_STUB IVLCVideo_get_aspectRatio_Stub( void __RPC_STUB IVLCVideo_get_aspectRatio_Stub(
IRpcStubBuffer* This, IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer, IRpcChannelBuffer* pRpcChannelBuffer,
......
...@@ -1758,9 +1758,9 @@ STDMETHODIMP VLCVideo::get_height(long* height) ...@@ -1758,9 +1758,9 @@ STDMETHODIMP VLCVideo::get_height(long* height)
return hr; return hr;
}; };
STDMETHODIMP VLCVideo::get_aspectRatio(BSTR *aspect) STDMETHODIMP VLCVideo::get_aspectRatio(BSTR aspect)
{ {
if( NULL == *aspect ) if( NULL == aspect )
return E_POINTER; return E_POINTER;
libvlc_instance_t* p_libvlc; libvlc_instance_t* p_libvlc;
...@@ -1775,19 +1775,16 @@ STDMETHODIMP VLCVideo::get_aspectRatio(BSTR *aspect) ...@@ -1775,19 +1775,16 @@ STDMETHODIMP VLCVideo::get_aspectRatio(BSTR *aspect)
{ {
char *psz_aspect = libvlc_video_get_aspect_ratio(p_input, &ex); 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; return E_OUTOFMEMORY;
if( ! libvlc_exception_raised(&ex) ) if( ! libvlc_exception_raised(&ex) )
{ {
*aspect = SysAllocStringByteLen(psz_aspect, strlen(psz_aspect)); aspect = SysAllocStringByteLen(psz_aspect, strlen(psz_aspect));
free( psz_aspect ); free( psz_aspect );
psz_aspect = NULL; psz_aspect = NULL;
libvlc_input_free(p_input); return NOERROR;
if( ! libvlc_exception_raised(&ex) )
{
return NOERROR;
}
} }
if( psz_aspect ) free( psz_aspect ); if( psz_aspect ) free( psz_aspect );
} }
......
...@@ -460,7 +460,7 @@ public: ...@@ -460,7 +460,7 @@ public:
STDMETHODIMP put_fullscreen(VARIANT_BOOL); STDMETHODIMP put_fullscreen(VARIANT_BOOL);
STDMETHODIMP get_width(long*); STDMETHODIMP get_width(long*);
STDMETHODIMP get_height(long*); STDMETHODIMP get_height(long*);
STDMETHODIMP get_aspectRatio(BSTR*); STDMETHODIMP get_aspectRatio(BSTR);
STDMETHODIMP put_aspectRatio(BSTR); STDMETHODIMP put_aspectRatio(BSTR);
STDMETHODIMP toggleFullscreen(); STDMETHODIMP toggleFullscreen();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment