diff options
author | Liong Sauw Ming <ming@teluu.com> | 2012-01-04 02:39:13 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2012-01-04 02:39:13 +0000 |
commit | 592c97e3faa6bd53a70a26002eccdb513488caef (patch) | |
tree | 8f96c60069c82819cee8b21447eab1a07ad044ae /pjmedia/src/pjmedia-videodev/dshow_dev.c | |
parent | cc5a03d5912410b3edf3f6d529cfb51172c26dd5 (diff) |
Fixed #1438: CoInitializeEx by application prevents dshow device from working
Return error if application already initialized COM library with a different concurrency model than what dshow_dev needs.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3934 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/pjmedia-videodev/dshow_dev.c')
-rw-r--r-- | pjmedia/src/pjmedia-videodev/dshow_dev.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia-videodev/dshow_dev.c b/pjmedia/src/pjmedia-videodev/dshow_dev.c index 875a0e89..30fd0ccb 100644 --- a/pjmedia/src/pjmedia-videodev/dshow_dev.c +++ b/pjmedia/src/pjmedia-videodev/dshow_dev.c @@ -209,7 +209,13 @@ pjmedia_vid_dev_factory* pjmedia_dshow_factory(pj_pool_factory *pf) /* API: init factory */ static pj_status_t dshow_factory_init(pjmedia_vid_dev_factory *f) { - CoInitializeEx(NULL, COINIT_MULTITHREADED); + HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); + if (hr == RPC_E_CHANGED_MODE) { + PJ_LOG(4,(THIS_FILE, "Failed initializing DShow: " + "COM library already initialized with " + "incompatible concurrency model")); + return PJMEDIA_EVID_INIT; + } return dshow_factory_refresh(f); } |