Changeset 2262 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Sep 4, 2008 1:55:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r2245 r2262 544 544 pjsua_media_channel_deinit(i); 545 545 } 546 if (pjsua_var.calls[i].med_tp ) {547 (*pjsua_var.calls[i].med_tp->op->destroy)(pjsua_var.calls[i].med_tp);548 pjsua_var.calls[i].med_tp = NULL;549 }546 if (pjsua_var.calls[i].med_tp && pjsua_var.calls[i].med_tp_auto_del) { 547 pjmedia_transport_close(pjsua_var.calls[i].med_tp); 548 } 549 pjsua_var.calls[i].med_tp = NULL; 550 550 } 551 551 … … 842 842 /* Delete existing media transports */ 843 843 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 844 if (pjsua_var.calls[i].med_tp != NULL) { 844 if (pjsua_var.calls[i].med_tp != NULL && 845 pjsua_var.calls[i].med_tp_auto_del) 846 { 845 847 pjmedia_transport_close(pjsua_var.calls[i].med_tp); 846 848 pjsua_var.calls[i].med_tp = NULL; … … 851 853 pjsua_transport_config_dup(pjsua_var.pool, &cfg, app_cfg); 852 854 855 /* Create the transports */ 853 856 if (pjsua_var.media_cfg.enable_ice) { 854 857 status = create_ice_media_transports(); … … 857 860 } 858 861 862 /* Set media transport auto_delete to True */ 863 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 864 pjsua_var.calls[i].med_tp_auto_del = PJ_TRUE; 865 } 859 866 860 867 PJSUA_UNLOCK(); 861 868 862 869 return status; 870 } 871 872 /* 873 * Attach application's created media transports. 874 */ 875 PJ_DEF(pj_status_t) pjsua_media_transports_attach(pjsua_media_transport tp[], 876 unsigned count, 877 pj_bool_t auto_delete) 878 { 879 unsigned i; 880 881 PJ_ASSERT_RETURN(tp && count==pjsua_var.ua_cfg.max_calls, PJ_EINVAL); 882 883 /* Assign the media transports */ 884 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 885 if (pjsua_var.calls[i].med_tp != NULL && 886 pjsua_var.calls[i].med_tp_auto_del) 887 { 888 pjmedia_transport_close(pjsua_var.calls[i].med_tp); 889 } 890 891 pjsua_var.calls[i].med_tp = tp[i].transport; 892 pjsua_var.calls[i].med_tp_auto_del = auto_delete; 893 } 894 895 return PJ_SUCCESS; 863 896 } 864 897
Note: See TracChangeset
for help on using the changeset viewer.