Changeset 3440
- Timestamp:
- Mar 15, 2011 3:16:33 AM (14 years ago)
- Location:
- pjproject/trunk/pjmedia/src/pjmedia-audiodev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/audiodev.c
r3438 r3440 251 251 252 252 /* Internal: init driver */ 253 static pj_status_t init_driver(unsigned drv_idx )253 static pj_status_t init_driver(unsigned drv_idx, pj_bool_t refresh) 254 254 { 255 255 struct driver *drv = &aud_subsys.drv[drv_idx]; … … 258 258 pj_status_t status; 259 259 260 /* Create the factory */ 261 f = (*drv->create)(aud_subsys.pf); 262 if (!f) 263 return PJ_EUNKNOWN; 264 265 /* Call factory->init() */ 266 status = f->op->init(f); 267 if (status != PJ_SUCCESS) { 268 f->op->destroy(f); 269 return status; 260 if (!refresh) { 261 /* Create the factory */ 262 f = (*drv->create)(aud_subsys.pf); 263 if (!f) 264 return PJ_EUNKNOWN; 265 266 /* Call factory->init() */ 267 status = f->op->init(f); 268 if (status != PJ_SUCCESS) { 269 f->op->destroy(f); 270 return status; 271 } 272 } else { 273 f = drv->f; 270 274 } 271 275 … … 408 412 /* Initialize each factory and build the device ID list */ 409 413 for (i=0; i<aud_subsys.drv_cnt; ++i) { 410 status = init_driver(i );414 status = init_driver(i, PJ_FALSE); 411 415 if (status != PJ_SUCCESS) { 412 416 deinit_driver(i); … … 428 432 429 433 aud_subsys.drv[aud_subsys.drv_cnt].create = adf; 430 status = init_driver(aud_subsys.drv_cnt );434 status = init_driver(aud_subsys.drv_cnt, PJ_FALSE); 431 435 if (status == PJ_SUCCESS) { 432 436 aud_subsys.drv_cnt++; … … 497 501 unsigned i; 498 502 503 aud_subsys.dev_cnt = 0; 499 504 for (i=0; i<aud_subsys.drv_cnt; ++i) { 500 505 struct driver *drv = &aud_subsys.drv[i]; … … 507 512 } 508 513 } 514 init_driver(i, PJ_TRUE); 509 515 } 510 516 return PJ_SUCCESS; -
pjproject/trunk/pjmedia/src/pjmedia-audiodev/wmme_dev.c
r3438 r3440 40 40 41 41 #ifndef PJMEDIA_WMME_DEV_USE_MMDEVICE_API 42 # define PJMEDIA WMME_DEV_USE_MMDEVICE_API \42 # define PJMEDIA_WMME_DEV_USE_MMDEVICE_API \ 43 43 (defined(_WIN32_WINNT) && (_WIN32_WINNT>=0x0600)) 44 44 #endif
Note: See TracChangeset
for help on using the changeset viewer.