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_player.c

    r582 r633  
    7878static struct file_port *create_file_port(pj_pool_t *pool) 
    7979{ 
     80    const pj_str_t name = pj_str("file"); 
    8081    struct file_port *port; 
    8182 
     
    8485        return NULL; 
    8586 
    86     port->base.info.name = pj_str("file"); 
    87     port->base.info.signature = SIGNATURE; 
    88     port->base.info.type = PJMEDIA_TYPE_AUDIO; 
    89     port->base.info.has_info = PJ_TRUE; 
    90     port->base.info.need_info = PJ_FALSE; 
    91     port->base.info.pt = 0xFF; 
    92     port->base.info.encoding_name = pj_str("pcm"); 
     87    /* Put in default values. 
     88     * These will be overriden once the file is read. 
     89     */ 
     90    pjmedia_port_info_init(&port->base.info, &name, SIGNATURE,  
     91                           8000, 1, 16, 80); 
    9392 
    9493    port->base.put_frame = &file_put_frame; 
     
    9695    port->base.on_destroy = &file_on_destroy; 
    9796 
    98  
    99     /* Put in default values. 
    100      * These will be overriden once the file is read. 
    101      */ 
    102     port->base.info.clock_rate = 8000; 
    103     port->base.info.bits_per_sample = 16; 
    104     port->base.info.samples_per_frame = 160; 
    105     port->base.info.bytes_per_frame = 320; 
    10697 
    10798    return port; 
     
    151142 
    152143                fport->eof = PJ_TRUE; 
    153                 status = (*fport->cb)(&fport->base, fport->base.user_data); 
     144                status=(*fport->cb)(&fport->base,fport->base.port_data.pdata); 
    154145                if (status != PJ_SUCCESS) { 
    155146                    /* This will crash if file port is destroyed in the  
     
    425416    fport = (struct file_port*) port; 
    426417 
    427     fport->base.user_data = user_data; 
     418    fport->base.port_data.pdata = user_data; 
    428419    fport->cb = cb; 
    429420 
Note: See TracChangeset for help on using the changeset viewer.