Ignore:
Timestamp:
Mar 15, 2006 7:32:41 PM (18 years ago)
Author:
bennylp
Message:

Added Null port, and changed conference so that it does not call port get_frame() when there is no listener on the port

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r315 r318  
    754754    } 
    755755 
     756    /* Add NULL port to the bridge. */ 
     757    status = pjmedia_null_port_create( pjsua.pool, pjsua.clock_rate,  
     758                                       pjsua.clock_rate * 20 / 1000, 16, 
     759                                       &pjsua.null_port); 
     760    pjmedia_conf_add_port( pjsua.mconf, pjsua.pool, pjsua.null_port,  
     761                           &pjsua.null_port->info.name, NULL ); 
     762 
    756763    /* Create WAV file player if required: */ 
    757764 
    758765    if (pjsua.wav_file) { 
    759         pjmedia_port *port; 
    760766        pj_str_t port_name; 
    761767 
    762768        /* Create the file player port. */ 
    763769        status = pjmedia_file_player_port_create( pjsua.pool, pjsua.wav_file, 
    764                                                   0, -1, NULL, &port); 
     770                                                  0, -1, NULL,  
     771                                                  &pjsua.file_port); 
    765772        if (status != PJ_SUCCESS) { 
    766773            pjsua_perror(THIS_FILE,  
     
    771778 
    772779        /* Add port to conference bridge: */ 
    773         status = pjmedia_conf_add_port(pjsua.mconf, pjsua.pool, port,  
     780        status = pjmedia_conf_add_port(pjsua.mconf, pjsua.pool,  
     781                                       pjsua.file_port,  
    774782                                       pj_cstr(&port_name, pjsua.wav_file), 
    775783                                       &pjsua.wav_slot); 
     
    10501058        pjmedia_conf_destroy(pjsua.mconf); 
    10511059 
     1060    /* Destroy file port */ 
     1061    pjmedia_port_destroy(pjsua.file_port); 
     1062 
     1063    /* Destroy null port. */ 
     1064    pjmedia_port_destroy(pjsua.null_port); 
     1065 
     1066 
    10521067    /* Destroy sound framework:  
    10531068     * (this should be done in pjmedia_shutdown()) 
Note: See TracChangeset for help on using the changeset viewer.