Ignore:
Timestamp:
Jul 29, 2006 11:14:47 AM (18 years ago)
Author:
bennylp
Message:

Added pjmedia_port_info_init() to fill in pjmedia_port_info structure, avoiding manual initialization and thus improves consistency (and probably reduces size by a tiny bit). This involves modification in quite few places.

File:
1 edited

Legend:

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

    r582 r633  
    7070    pjmedia_wave_hdr wave_hdr; 
    7171    pj_ssize_t size; 
     72    pj_str_t name; 
    7273    pj_status_t status; 
    7374 
     
    8788 
    8889    /* Initialize port info. */ 
    89     fport->base.info.bits_per_sample = bits_per_sample; 
    90     fport->base.info.bytes_per_frame = samples_per_frame * bits_per_sample * 
    91                                        channel_count / 8; 
    92     fport->base.info.channel_count = channel_count; 
    93     fport->base.info.encoding_name = pj_str("pom"); 
    94     fport->base.info.has_info = 1; 
    95     pj_strdup2(pool, &fport->base.info.name, filename); 
    96     fport->base.info.need_info = 0; 
    97     fport->base.info.pt = 0xFF; 
    98     fport->base.info.clock_rate = sampling_rate; 
    99     fport->base.info.samples_per_frame = samples_per_frame; 
    100     fport->base.info.signature = SIGNATURE; 
    101     fport->base.info.type = PJMEDIA_TYPE_AUDIO; 
    102      
     90    pj_strdup2(pool, &name, filename); 
     91    pjmedia_port_info_init(&fport->base.info, &name, SIGNATURE, 
     92                           sampling_rate, channel_count, bits_per_sample, 
     93                           samples_per_frame); 
     94 
    10395    fport->base.get_frame = &file_get_frame; 
    10496    fport->base.put_frame = &file_put_frame; 
     
    221213 
    222214    fport->cb_size = pos; 
    223     fport->base.user_data = user_data; 
     215    fport->base.port_data.pdata = user_data; 
    224216    fport->cb = cb; 
    225217 
     
    294286        fport->cb = NULL; 
    295287 
    296         status = (*cb)(this_port, this_port->user_data); 
     288        status = (*cb)(this_port, this_port->port_data.pdata); 
    297289        return status; 
    298290    } 
Note: See TracChangeset for help on using the changeset viewer.