Ignore:
Timestamp:
Dec 10, 2010 8:55:13 PM (14 years ago)
Author:
nanang
Message:

Re #1176: fixed build config for MSVC2005

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/confbench.c

    r2394 r3394  
    148148 
    149149    /* Get number of samples */ 
    150     count = frame->size / 2 / port->info.channel_count; 
     150    count = frame->size / 2 / PJMEDIA_PIA_CCNT(&port->info); 
    151151 
    152152    left = 0; 
     
    157157        ++left; 
    158158 
    159         if (port->info.channel_count == 2) { 
     159        if (PJMEDIA_PIA_CCNT(&port->info) == 2) { 
    160160            *samples++ = sine->samples[right]; 
    161161            right += 2; /* higher pitch so we can distinguish left and right. */ 
     
    188188    unsigned i; 
    189189    unsigned count; 
     190    pj_str_t port_name; 
    190191    port_data *sine; 
    191192 
     
    197198 
    198199    /* Fill in port info. */ 
    199     port->info.bits_per_sample = 16; 
    200     port->info.channel_count = channel_count; 
    201     port->info.encoding_name = pj_str("pcm"); 
    202     port->info.has_info = 1; 
    203     port->info.name = pj_str("sine generator"); 
    204     port->info.need_info = 0; 
    205     port->info.pt = 0xFF; 
    206     port->info.clock_rate = sampling_rate; 
    207     port->info.samples_per_frame = sampling_rate * SINE_PTIME / 1000 * channel_count; 
    208     port->info.bytes_per_frame = port->info.samples_per_frame * 2; 
    209     port->info.type = PJMEDIA_TYPE_AUDIO; 
     200    port_name = pj_str("sine generator"); 
     201    pjmedia_port_info_init(&port->info, &port_name, 
     202                           12345, sampling_rate, channel_count, 16,  
     203                           sampling_rate * SINE_PTIME / 1000 * channel_count); 
    210204     
    211205    /* Set the function to feed frame */ 
     
    216210 
    217211    /* Create samples */ 
    218     count = port->info.samples_per_frame / channel_count; 
     212    count = PJMEDIA_PIA_SPF(&port->info) / channel_count; 
    219213    sine->samples = pj_pool_alloc(pool, count * sizeof(pj_int16_t)); 
    220214    PJ_ASSERT_RETURN(sine->samples != NULL, PJ_ENOMEM); 
Note: See TracChangeset for help on using the changeset viewer.