]> git.sesse.net Git - vlc/blobdiff - projects/activex/vlccontrol2.cpp
macosx/framework: Make sure remainingTime is KVO.
[vlc] / projects / activex / vlccontrol2.cpp
index 7e90e2af37a77b8ae360921763680e6b8bdb5a58..05080bc0da7cb99ab47efe964d1d6eb1a0fbc152 100644 (file)
@@ -38,7 +38,7 @@ HRESULT _exception_bridge(VLCPlugin *p,REFIID riid, libvlc_exception_t *ex)
 {
     if( libvlc_exception_raised(ex) )
     {
-        p->setErrorInfo(riid,libvlc_exception_get_message(ex));
+        p->setErrorInfo(riid,libvlc_errmsg());
         libvlc_exception_clear(ex);
         return E_FAIL;
     }
@@ -148,14 +148,8 @@ STDMETHODIMP VLCAudio::get_mute(VARIANT_BOOL* mute)
     libvlc_instance_t* p_libvlc;
     HRESULT hr = _p_instance->getVLC(&p_libvlc);
     if( SUCCEEDED(hr) )
-    {
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
-        *mute = libvlc_audio_get_mute(p_libvlc, &ex) ?
+        *mute = libvlc_audio_get_mute(p_libvlc) ?
                         VARIANT_TRUE : VARIANT_FALSE;
-        hr = exception_bridge(&ex);
-    }
     return hr;
 };
 
@@ -164,13 +158,7 @@ STDMETHODIMP VLCAudio::put_mute(VARIANT_BOOL mute)
     libvlc_instance_t* p_libvlc;
     HRESULT hr = _p_instance->getVLC(&p_libvlc);
     if( SUCCEEDED(hr) )
-    {
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
-        libvlc_audio_set_mute(p_libvlc, VARIANT_FALSE != mute, &ex);
-        hr = exception_bridge(&ex);
-    }
+        libvlc_audio_set_mute(p_libvlc, VARIANT_FALSE != mute);
     return hr;
 };
 
@@ -182,13 +170,7 @@ STDMETHODIMP VLCAudio::get_volume(long* volume)
     libvlc_instance_t* p_libvlc;
     HRESULT hr = _p_instance->getVLC(&p_libvlc);
     if( SUCCEEDED(hr) )
-    {
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
-        *volume = libvlc_audio_get_volume(p_libvlc, &ex);
-        hr = exception_bridge(&ex);
-    }
+        *volume = libvlc_audio_get_volume(p_libvlc);
     return hr;
 };
 
@@ -349,13 +331,7 @@ STDMETHODIMP VLCAudio::toggleMute()
     libvlc_instance_t* p_libvlc;
     HRESULT hr = _p_instance->getVLC(&p_libvlc);
     if( SUCCEEDED(hr) )
-    {
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
-        libvlc_audio_toggle_mute(p_libvlc, &ex);
-        hr = exception_bridge(&ex);
-    }
+        libvlc_audio_toggle_mute(p_libvlc);
     return hr;
 };
 
@@ -1346,7 +1322,10 @@ STDMETHODIMP VLCMessageIterator::next(IVLCMessage** message)
 
         buffer.sizeof_msg = sizeof(buffer);
 
-        libvlc_log_iterator_next(_p_iter, &buffer);
+        libvlc_exception_t ex;
+        libvlc_exception_init(&ex);
+
+        libvlc_log_iterator_next(_p_iter, &buffer, &ex);
         *message = new VLCMessage(_p_instance, buffer);
         if( !message )
             hr = E_OUTOFMEMORY;