forked from mia/Aegisub
Don't init COM for FFMS2
FFMS2 no longer uses COM for anything.
This commit is contained in:
parent
8823476275
commit
b8fa7e010b
|
@ -50,29 +50,9 @@
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
#include <wx/choicdlg.h>
|
#include <wx/choicdlg.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <objbase.h>
|
|
||||||
|
|
||||||
static void deinit_com(bool) {
|
|
||||||
CoUninitialize();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void deinit_com(bool) { }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FFmpegSourceProvider::FFmpegSourceProvider(agi::BackgroundRunner *br)
|
FFmpegSourceProvider::FFmpegSourceProvider(agi::BackgroundRunner *br)
|
||||||
: COMInited(false, deinit_com)
|
: br(br)
|
||||||
, br(br)
|
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
HRESULT res = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
|
|
||||||
if (SUCCEEDED(res))
|
|
||||||
COMInited = true;
|
|
||||||
else if (res != RPC_E_CHANGED_MODE)
|
|
||||||
throw agi::EnvironmentError("COM initialization failure");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// initialize ffmpegsource
|
|
||||||
FFMS_Init(0, 1);
|
FFMS_Init(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ namespace agi { class BackgroundRunner; }
|
||||||
/// @brief Base class for FFMS2 source providers; contains common functions etc
|
/// @brief Base class for FFMS2 source providers; contains common functions etc
|
||||||
class FFmpegSourceProvider {
|
class FFmpegSourceProvider {
|
||||||
friend class FFmpegSourceCacheCleaner;
|
friend class FFmpegSourceCacheCleaner;
|
||||||
agi::scoped_holder<bool> COMInited; ///< COM initialization state
|
|
||||||
agi::BackgroundRunner *br;
|
agi::BackgroundRunner *br;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue