Changeset 3941


Ignore:
Timestamp:
Jan 12, 2012 6:09:08 AM (12 years ago)
Author:
nanang
Message:

Fix #1447: fix internal function write_frame() of the switchboard to copy the whole source frame to the destination port buffer if the destination port is port 0 (previously it only copied as much as samples-per-frame of port 0).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/src/pjmedia/conf_switch.c

    r3553 r3941  
    10741074            unsigned nsamples_to_copy, nsamples_req; 
    10751075 
    1076             /* Copy frame to listener's TX buffer. */ 
     1076            /* Copy frame to listener's TX buffer. 
     1077             * Note that if the destination is port 0, just copy the whole 
     1078             * available samples. 
     1079             */ 
    10771080            nsamples_to_copy = f_end - f_start; 
    10781081            nsamples_req = cport_dst->info->samples_per_frame -  
    10791082                          (frm_dst->size>>1); 
    1080             if (nsamples_to_copy > nsamples_req) 
     1083            if (cport_dst->slot && nsamples_to_copy > nsamples_req) 
    10811084                nsamples_to_copy = nsamples_req; 
    10821085 
     
    11111114            /* Check if it's time to deliver the TX buffer to listener,  
    11121115             * i.e: samples count in TX buffer equal to listener's 
    1113              * samples per frame. 
     1116             * samples per frame. Note that for destination port 0 this 
     1117             * function will just populate all samples in the TX buffer. 
    11141118             */ 
    1115             if ((frm_dst->size >> 1) == cport_dst->info->samples_per_frame) 
     1119            if (cport_dst->slot == 0) { 
     1120                /* Update TX timestamp. */ 
     1121                pj_add_timestamp32(&cport_dst->ts_tx, nsamples_to_copy); 
     1122            } else if ((frm_dst->size >> 1) ==  
     1123                       cport_dst->info->samples_per_frame) 
    11161124            { 
    1117                 if (cport_dst->slot) { 
    1118                     pjmedia_port_put_frame(cport_dst->port, frm_dst); 
    1119  
    1120                     /* Reset TX buffer. */ 
    1121                     frm_dst->size = 0; 
    1122                 } 
     1125                pjmedia_port_put_frame(cport_dst->port, frm_dst); 
     1126 
     1127                /* Reset TX buffer. */ 
     1128                frm_dst->size = 0; 
    11231129 
    11241130                /* Update TX timestamp. */ 
Note: See TracChangeset for help on using the changeset viewer.