Changeset 930 for pjproject


Ignore:
Timestamp:
Feb 4, 2007 4:00:13 PM (18 years ago)
Author:
bennylp
Message:

Fixed ticket #87: Conference bridge should transmit silence frame when level is zero and there is a transmitter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/conference.c

    r899 r930  
    13241324     * transmit NULL frame.  
    13251325     */ 
    1326     /* note: 
    1327      *  the "cport->src_level==0" checking will cause discontinuous 
    1328      *  transmission for RTP stream. 
    1329      */ 
    1330     if (cport->tx_setting == PJMEDIA_PORT_MUTE || cport->src_level==0) { 
     1326    if (cport->tx_setting == PJMEDIA_PORT_MUTE || cport->transmitter_cnt==0) { 
    13311327 
    13321328        pjmedia_frame frame; 
     
    13461342        *frm_type = PJMEDIA_FRAME_TYPE_NONE; 
    13471343        return PJ_SUCCESS; 
     1344 
     1345    } else if (cport->src_level==0) { 
     1346 
     1347        pjmedia_frame frame; 
     1348 
     1349        /* If silence is transmitted to this port, transmit silence 
     1350         * PCM frame (otherwise if we transmit NULL frame, nothing will 
     1351         * be written to WAV port). This would work with stream too 
     1352         * since stream has it's own silence detector. 
     1353         */ 
     1354        pjmedia_zero_samples((pj_int16_t*)cport->mix_buf,  
     1355                             cport->samples_per_frame); 
     1356 
     1357        /* Adjust the timestamp */ 
     1358        frame.timestamp.u64 = timestamp->u64 * cport->clock_rate / 
     1359                                conf->clock_rate; 
     1360        frame.type = PJMEDIA_FRAME_TYPE_NONE; 
     1361        frame.buf = (void*)cport->mix_buf; 
     1362        frame.size = (cport->samples_per_frame << 1); 
     1363 
     1364        if (cport->port && cport->port->put_frame) { 
     1365            pjmedia_port_put_frame(cport->port, &frame); 
     1366        } 
     1367 
     1368        cport->tx_level = 0; 
     1369        *frm_type = PJMEDIA_FRAME_TYPE_NONE; 
     1370        return PJ_SUCCESS; 
     1371 
    13481372 
    13491373    } else if (cport->tx_setting != PJMEDIA_PORT_ENABLE) { 
Note: See TracChangeset for help on using the changeset viewer.