diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-05-20 03:33:02 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-05-20 03:33:02 +0400 |
commit | da190930a656082cf04bd8cd33b094b9cff75e65 (patch) | |
tree | cfae1eaecf91c75c57b0f629ff1aa3b23b9b1344 | |
parent | 96c2f0f0be9e99426a7a1e29e6662da5f1f3b6f0 (diff) |
Delay network init until the splitter is actually initalized.
We can't call WSAStartup from within DllMain, so wait until we're actually being instanciated.
Fixes issue 358
-rw-r--r-- | demuxer/Demuxers/LAVFDemuxer.cpp | 5 | ||||
-rw-r--r-- | demuxer/Demuxers/LAVFDemuxer.h | 2 | ||||
-rw-r--r-- | demuxer/LAVSplitter/LAVSplitter.cpp | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/demuxer/Demuxers/LAVFDemuxer.cpp b/demuxer/Demuxers/LAVFDemuxer.cpp index cd335dfb..b8b612d0 100644 --- a/demuxer/Demuxers/LAVFDemuxer.cpp +++ b/demuxer/Demuxers/LAVFDemuxer.cpp @@ -54,7 +54,7 @@ extern void lavf_get_iformat_infos(AVInputFormat *pFormat, const char **pszName, static const AVRational AV_RATIONAL_TIMEBASE = {1, AV_TIME_BASE}; -void CLAVFDemuxer::ffmpeg_init() +void CLAVFDemuxer::ffmpeg_init(bool network) { #ifdef DEBUG DbgSetModuleLevel (LOG_CUSTOM1, DWORD_MAX); // FFMPEG messages use custom1 @@ -64,7 +64,8 @@ void CLAVFDemuxer::ffmpeg_init() #endif av_register_all(); - avformat_network_init(); + if (network) + avformat_network_init(); } std::set<FormatInfo> CLAVFDemuxer::GetFormatList() diff --git a/demuxer/Demuxers/LAVFDemuxer.h b/demuxer/Demuxers/LAVFDemuxer.h index 5214c55c..86ae6f23 100644 --- a/demuxer/Demuxers/LAVFDemuxer.h +++ b/demuxer/Demuxers/LAVFDemuxer.h @@ -39,7 +39,7 @@ public: CLAVFDemuxer(CCritSec *pLock, ILAVFSettingsInternal *settings); ~CLAVFDemuxer(); - static void ffmpeg_init(); + static void ffmpeg_init(bool network); static std::set<FormatInfo> GetFormatList(); // IUnknown diff --git a/demuxer/LAVSplitter/LAVSplitter.cpp b/demuxer/LAVSplitter/LAVSplitter.cpp index 3430c275..4bbf28e3 100644 --- a/demuxer/LAVSplitter/LAVSplitter.cpp +++ b/demuxer/LAVSplitter/LAVSplitter.cpp @@ -41,7 +41,7 @@ void CALLBACK CLAVSplitter::StaticInit(BOOL bLoading, const CLSID *clsid) { if (!bLoading) return; - CLAVFDemuxer::ffmpeg_init(); + CLAVFDemuxer::ffmpeg_init(false); } CLAVSplitter::CLAVSplitter(LPUNKNOWN pUnk, HRESULT* phr) @@ -65,7 +65,7 @@ CLAVSplitter::CLAVSplitter(LPUNKNOWN pUnk, HRESULT* phr) GetModuleFileName(NULL, fileName, 1024); m_processName = PathFindFileName (fileName); - StaticInit(TRUE, NULL); + CLAVFDemuxer::ffmpeg_init(true); m_InputFormats.clear(); |