Ignore:
Timestamp:
May 30, 2008 11:30:24 AM (11 years ago)
Author:
nanang
Message:

Updated delaybuf to learn burst level in realtime instead of only in the beginning, this can optimize the latency and increase adaptivity

File:
1 edited

Legend:

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

    r1836 r1972  
    373373    pjmedia_snd_port *snd_port; 
    374374    pj_status_t status; 
     375    unsigned ptime; 
    375376 
    376377    PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 
     
    389390     
    390391#if PJMEDIA_SOUND_USE_DELAYBUF 
     392    ptime = samples_per_frame * 1000 / (clock_rate * channel_count); 
     393 
    391394    status = pjmedia_delay_buf_create(pool, "snd_buff",  
    392                                       clock_rate, samples_per_frame,  
    393                                       PJMEDIA_SOUND_BUFFER_COUNT, -1,  
     395                                      clock_rate, samples_per_frame, 
     396                                      channel_count, 
     397                                      PJMEDIA_SOUND_BUFFER_COUNT * ptime, 
    394398                                      0, &snd_port->delay_buf); 
    395399    PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 
    396400#else 
    397401    PJ_UNUSED_ARG(status); 
     402    PJ_UNUSED_ARG(ptime); 
    398403#endif 
    399404 
Note: See TracChangeset for help on using the changeset viewer.