X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=projects%2Factivex%2Fvlccontrol2.cpp;h=05080bc0da7cb99ab47efe964d1d6eb1a0fbc152;hb=16350c64e3aeaf4bb10bb897dfd3634de55a0722;hp=7e90e2af37a77b8ae360921763680e6b8bdb5a58;hpb=473c2db36c8bc678ff4259721dc2ba3bff5c84a5;p=vlc diff --git a/projects/activex/vlccontrol2.cpp b/projects/activex/vlccontrol2.cpp index 7e90e2af37..05080bc0da 100644 --- a/projects/activex/vlccontrol2.cpp +++ b/projects/activex/vlccontrol2.cpp @@ -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;