- Timestamp:
- Jun 16, 2008 9:52:50 AM (16 years ago)
- Location:
- pjproject/trunk/pjsip/src/pjsua-lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r1961 r2027 348 348 349 349 PJSUA_LOCK(); 350 351 /* Create sound port if none is instantiated */ 352 if (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL && 353 !pjsua_var.no_snd) 354 { 355 pj_status_t status; 356 357 status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 358 if (status != PJ_SUCCESS) { 359 PJSUA_UNLOCK(); 360 return status; 361 } 362 } 350 363 351 364 acc = &pjsua_var.acc[acc_id]; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r2018 r2027 426 426 } 427 427 428 /* Check if sound device is idle. */ 429 static void check_snd_dev_idle() 430 { 431 432 /* Activate sound device auto-close timer if sound device is idle. 433 * It is idle when there is no port connection in the bridge. 434 */ 435 if ((pjsua_var.snd_port!=NULL || pjsua_var.null_snd!=NULL) && 436 pjsua_var.snd_idle_timer.id == PJ_FALSE && 437 pjmedia_conf_get_connect_count(pjsua_var.mconf) == 0 && 438 pjsua_var.media_cfg.snd_auto_close_time >= 0) 439 { 440 pj_time_val delay; 441 442 delay.msec = 0; 443 delay.sec = pjsua_var.media_cfg.snd_auto_close_time; 444 445 pjsua_var.snd_idle_timer.id = PJ_TRUE; 446 pjsip_endpt_schedule_timer(pjsua_var.endpt, &pjsua_var.snd_idle_timer, 447 &delay); 448 } 449 } 450 451 428 452 /* Timer callback to close sound device */ 429 453 static void close_snd_timer_cb( pj_timer_heap_t *th, … … 966 990 if (call->conf_slot != PJSUA_INVALID_ID) { 967 991 if (pjsua_var.mconf) { 968 pj media_conf_remove_port(pjsua_var.mconf,call->conf_slot);992 pjsua_conf_remove_port(call->conf_slot); 969 993 } 970 994 call->conf_slot = PJSUA_INVALID_ID; … … 1326 1350 PJ_DEF(pj_status_t) pjsua_conf_remove_port(pjsua_conf_port_id id) 1327 1351 { 1328 return pjmedia_conf_remove_port(pjsua_var.mconf, (unsigned)id); 1352 pj_status_t status; 1353 1354 status = pjmedia_conf_remove_port(pjsua_var.mconf, (unsigned)id); 1355 check_snd_dev_idle(); 1356 1357 return status; 1329 1358 } 1330 1359 … … 1368 1397 1369 1398 status = pjmedia_conf_disconnect_port(pjsua_var.mconf, source, sink); 1370 if (status != PJ_SUCCESS) 1371 return status; 1372 1373 /* If no port is connected, sound device must be idle. Activate sound 1374 * device auto-close timer. 1375 */ 1376 if ((pjsua_var.snd_port!=NULL || pjsua_var.null_snd!=NULL) && 1377 pjsua_var.snd_idle_timer.id==PJ_FALSE && 1378 pjmedia_conf_get_connect_count(pjsua_var.mconf) == 0 && 1379 pjsua_var.media_cfg.snd_auto_close_time >= 0) 1380 { 1381 pj_time_val delay; 1382 1383 delay.msec = 0; 1384 delay.sec = pjsua_var.media_cfg.snd_auto_close_time; 1385 1386 pjsua_var.snd_idle_timer.id = PJ_TRUE; 1387 pjsip_endpt_schedule_timer(pjsua_var.endpt, &pjsua_var.snd_idle_timer, 1388 &delay); 1389 } 1399 check_snd_dev_idle(); 1390 1400 1391 1401 return status; … … 1649 1659 1650 1660 if (pjsua_var.player[id].port) { 1651 pjmedia_conf_remove_port(pjsua_var.mconf, 1652 pjsua_var.player[id].slot); 1661 pjsua_conf_remove_port(pjsua_var.player[id].slot); 1653 1662 pjmedia_port_destroy(pjsua_var.player[id].port); 1654 1663 pjsua_var.player[id].port = NULL; … … 1825 1834 1826 1835 if (pjsua_var.recorder[id].port) { 1827 pjmedia_conf_remove_port(pjsua_var.mconf, 1828 pjsua_var.recorder[id].slot); 1836 pjsua_conf_remove_port(pjsua_var.recorder[id].slot); 1829 1837 pjmedia_port_destroy(pjsua_var.recorder[id].port); 1830 1838 pjsua_var.recorder[id].port = NULL;
Note: See TracChangeset
for help on using the changeset viewer.