Changeset 3934


Ignore:
Timestamp:
Jan 4, 2012 2:39:13 AM (8 years ago)
Author:
ming
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-videodev/dshow_dev.c

    r3901 r3934  
    210210static pj_status_t dshow_factory_init(pjmedia_vid_dev_factory *f) 
    211211{ 
    212     CoInitializeEx(NULL, COINIT_MULTITHREADED); 
     212    HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); 
     213    if (hr == RPC_E_CHANGED_MODE) { 
     214        PJ_LOG(4,(THIS_FILE, "Failed initializing DShow: " 
     215                             "COM library already initialized with " 
     216                             "incompatible concurrency model")); 
     217        return PJMEDIA_EVID_INIT; 
     218    } 
    213219 
    214220    return dshow_factory_refresh(f); 
Note: See TracChangeset for help on using the changeset viewer.