Changeset 4694


Ignore:
Timestamp:
Dec 17, 2013 9:01:21 AM (10 years ago)
Author:
nanang
Message:

Fixed #1717: Destroy media subsystem after all pollings/busy_sleep() are done, but leave deallocating media transport (via pjsua_media_channel_deinit()) before the pollings to allow clean TURN destroy.

Location:
pjproject/trunk/pjsip/src/pjsua-lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r4610 r4694  
    15051505        } 
    15061506 
     1507        /* Deinit media channel of all calls (see #1717) */ 
     1508        for (i=0; i<(int)pjsua_var.ua_cfg.max_calls; ++i) { 
     1509            /* TODO: check if we're not allowed to send to network in the 
     1510             *       "flags", and if so do not do TURN allocation... 
     1511             */ 
     1512            pjsua_media_channel_deinit(i); 
     1513        } 
     1514 
    15071515        /* Set all accounts to offline */ 
    15081516        for (i=0; i<(int)PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { 
     
    15151523        /* Terminate all presence subscriptions. */ 
    15161524        pjsua_pres_shutdown(flags); 
    1517  
    1518         /* Destroy media (to shutdown media transports etc) */ 
    1519         pjsua_media_subsys_destroy(flags); 
    15201525 
    15211526        /* Wait for sometime until all publish client sessions are done 
     
    16211626 
    16221627        PJ_LOG(4,(THIS_FILE, "Destroying...")); 
     1628 
     1629        /* Destroy media (to shutdown media endpoint, etc) */ 
     1630        pjsua_media_subsys_destroy(flags); 
    16231631 
    16241632        /* Must destroy endpoint first before destroying pools in 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r4614 r4694  
    180180pj_status_t pjsua_media_subsys_destroy(unsigned flags) 
    181181{ 
    182     unsigned i; 
     182    PJ_UNUSED_ARG(flags); 
    183183 
    184184    PJ_LOG(4,(THIS_FILE, "Shutting down media..")); 
     
    192192    } 
    193193 
     194#if 0 
     195    // This part has been moved out to pjsua_destroy() (see also #1717). 
    194196    /* Close media transports */ 
    195197    for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 
     
    200202        pjsua_media_channel_deinit(i); 
    201203    } 
     204#endif 
    202205 
    203206    /* Destroy media endpoint. */ 
Note: See TracChangeset for help on using the changeset viewer.