Changeset 2790 for pjproject


Ignore:
Timestamp:
Jun 24, 2009 3:26:59 PM (15 years ago)
Author:
nanang
Message:

Ticket #835: backported changes from ticket #834

Location:
pjproject/branches/1.0
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0

  • pjproject/branches/1.0/pjmedia/include/pjmedia/conference.h

    r2394 r2790  
    225225 
    226226/** 
     227 * <i><b>Warning:</b> This API has been deprecated since 1.3 and will be 
     228 * removed in the future release, use #PJMEDIA_SPLITCOMB instead.</i> 
     229 * 
    227230 * Create and add a passive media port to the conference bridge. Unlike 
    228231 * "normal" media port that is added with #pjmedia_conf_add_port(), media 
  • pjproject/branches/1.0/pjmedia/src/pjmedia/conference.c

    r2789 r2790  
    571571    /* Create port zero for sound device. */ 
    572572    status = create_sound_port(pool, conf); 
    573     if (status != PJ_SUCCESS) 
     573    if (status != PJ_SUCCESS) { 
     574        pjmedia_conf_destroy(conf); 
    574575        return status; 
     576    } 
    575577 
    576578    /* Create mutex. */ 
    577579    status = pj_mutex_create_recursive(pool, "conf", &conf->mutex); 
    578     if (status != PJ_SUCCESS) 
     580    if (status != PJ_SUCCESS) { 
     581        pjmedia_conf_destroy(conf); 
    579582        return status; 
     583    } 
    580584 
    581585    /* If sound device was created, connect sound device to the 
     
    626630PJ_DEF(pj_status_t) pjmedia_conf_destroy( pjmedia_conf *conf ) 
    627631{ 
     632    unsigned i, ci; 
     633 
    628634    PJ_ASSERT_RETURN(conf != NULL, PJ_EINVAL); 
    629635 
     
    634640    } 
    635641 
     642    /* Destroy delay buf of all (passive) ports. */ 
     643    for (i=0, ci=0; i<conf->max_ports && ci<conf->port_cnt; ++i) { 
     644        struct conf_port *cport; 
     645 
     646        cport = conf->ports[i]; 
     647        if (!cport) 
     648            continue; 
     649         
     650        ++ci; 
     651        if (cport->delay_buf) { 
     652            pjmedia_delay_buf_destroy(cport->delay_buf); 
     653            cport->delay_buf = NULL; 
     654        } 
     655    } 
     656 
    636657    /* Destroy mutex */ 
    637     pj_mutex_destroy(conf->mutex); 
     658    if (conf->mutex) 
     659        pj_mutex_destroy(conf->mutex); 
    638660 
    639661    return PJ_SUCCESS; 
     
    793815    pj_status_t status; 
    794816 
     817    PJ_LOG(1, (THIS_FILE, "This API has been deprecated since 1.3 and will " 
     818                          "be removed in the future release!")); 
     819 
    795820    PJ_ASSERT_RETURN(conf && pool, PJ_EINVAL); 
    796821 
     
    11211146        pj_assert(conf->connect_cnt > 0); 
    11221147        --conf->connect_cnt; 
     1148    } 
     1149 
     1150    /* Destroy pjmedia port if this conf port is passive port, 
     1151     * i.e: has delay buf. 
     1152     */ 
     1153    if (conf_port->delay_buf) { 
     1154        pjmedia_port_destroy(conf_port->port); 
     1155        conf_port->port = NULL; 
    11231156    } 
    11241157 
  • pjproject/branches/1.0/pjmedia/src/pjmedia/delaybuf.c

    r2394 r2790  
    122122    b->recalc_timer = RECALC_TIME; 
    123123 
    124     status = pj_lock_create_recursive_mutex(pool, b->obj_name,  
    125                                             &b->lock); 
    126     if (status != PJ_SUCCESS) 
    127         return status; 
    128  
     124    /* Create circular buffer */ 
    129125    status = pjmedia_circ_buf_create(pool, b->max_cnt, &b->circ_buf); 
    130126    if (status != PJ_SUCCESS) 
    131127        return status; 
    132128 
     129    /* Create WSOLA */ 
    133130    status = pjmedia_wsola_create(pool, clock_rate, samples_per_frame, 1, 
    134131                                  0, &b->wsola); 
     132    if (status != PJ_SUCCESS) 
     133        return status; 
     134 
     135    /* Finally, create mutex */ 
     136    status = pj_lock_create_recursive_mutex(pool, b->obj_name,  
     137                                            &b->lock); 
    135138    if (status != PJ_SUCCESS) 
    136139        return status; 
  • pjproject/branches/1.0/pjmedia/src/pjmedia/echo_common.c

    r2394 r2790  
    240240{ 
    241241    (*echo->op->ec_destroy)(echo->state); 
     242 
     243    if (echo->delay_buf) { 
     244        pjmedia_delay_buf_destroy(echo->delay_buf); 
     245        echo->delay_buf = NULL; 
     246    } 
     247 
    242248    pj_pool_release(echo->pool); 
    243249    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.