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/mem_player.c

    r532 r633  
    5959{ 
    6060    struct mem_player *port; 
     61    pj_str_t name = pj_str("memplayer"); 
    6162 
    6263    /* Sanity check */ 
     
    7374 
    7475    /* Create the port */ 
    75     port->base.info.name = pj_str("memplayer"); 
    76     port->base.info.signature = SIGNATURE; 
    77     port->base.info.type = PJMEDIA_TYPE_AUDIO; 
    78     port->base.info.has_info = PJ_TRUE; 
    79     port->base.info.need_info = PJ_FALSE; 
    80     port->base.info.pt = 0xFF; 
    81     port->base.info.encoding_name = pj_str("pcm"); 
     76    pjmedia_port_info_init(&port->base.info, &name, SIGNATURE, clock_rate, 
     77                           channel_count, bits_per_sample, samples_per_frame); 
    8278 
    8379    port->base.put_frame = &mem_put_frame; 
     
    8581    port->base.on_destroy = &mem_on_destroy; 
    8682 
    87     port->base.info.clock_rate = clock_rate; 
    88     port->base.info.channel_count = channel_count; 
    89     port->base.info.bits_per_sample = bits_per_sample; 
    90     port->base.info.samples_per_frame = samples_per_frame; 
    91     port->base.info.bytes_per_frame = samples_per_frame * bits_per_sample / 2; 
    9283 
    9384    /* Save the buffer */ 
Note: See TracChangeset for help on using the changeset viewer.