if( NULL == _p_libvlc )
{
// initialize persistable properties
- _b_autoplay = TRUE;
- _b_autoloop = FALSE;
+ _b_autoplay = TRUE;
+ _b_autoloop = FALSE;
+ _b_toolbar = FALSE;
_bstr_baseurl = NULL;
- _bstr_mrl = NULL;
- _b_visible = TRUE;
- _b_mute = FALSE;
- _i_volume = 50;
- _i_time = 0;
- _i_backcolor = 0;
+ _bstr_mrl = NULL;
+ _b_visible = TRUE;
+ _b_mute = FALSE;
+ _i_volume = 50;
+ _i_time = 0;
+ _i_backcolor = 0;
// set default/preferred size (320x240) pixels in HIMETRIC
HDC hDC = CreateDevDC(NULL);
_extent.cx = 320;
return S_OK;
};
-HRESULT VLCPlugin::getVLCObject(int* i_vlc)
-{
- libvlc_instance_t *p_libvlc;
- HRESULT result = getVLC(&p_libvlc);
- if( SUCCEEDED(result) )
- {
- *i_vlc = libvlc_get_vlc_id(p_libvlc);
- }
- else
- {
- *i_vlc = 0;
- }
- return result;
-}
-
HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
{
extern HMODULE DllGetModule();
/* common settings */
ppsz_argv[ppsz_argc++] = "--no-stats";
ppsz_argv[ppsz_argc++] = "--no-media-library";
+ ppsz_argv[ppsz_argc++] = "--ignore-config";
ppsz_argv[ppsz_argc++] = "--intf=dummy";
// loop mode is a configuration option only
if( _b_autoloop )
ppsz_argv[ppsz_argc++] = "--loop";
- _p_libvlc = libvlc_new(ppsz_argc, ppsz_argv, NULL);
- if( NULL == _p_libvlc )
+ libvlc_exception_t ex;
+ libvlc_exception_init(&ex);
+
+ _p_libvlc = libvlc_new(ppsz_argc, ppsz_argv, &ex);
+ if( libvlc_exception_raised(&ex) )
{
*pp_libvlc = NULL;
+ libvlc_exception_clear(&ex);
return E_FAIL;
}
_p_libvlc = NULL;
vlcDataObject->onClose();
- libvlc_release(p_libvlc);
+ if( p_libvlc )
+ libvlc_release(p_libvlc);
}
return S_OK;
};