Changeset 1831


Ignore:
Timestamp:
Feb 29, 2008 12:00:46 PM (17 years ago)
Author:
bennylp
Message:

Added pjmedia_wsola_reset()

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/wsola.h

    r1827 r1831  
    100100 
    101101/** 
     102 * Reset the buffer contents of WSOLA. 
     103 * 
     104 * @param wsola     WSOLA session. 
     105 * @param options   Reset options, must be zero for now. 
     106 * 
     107 * @return          PJ_SUCCESS normally. 
     108 */ 
     109PJ_DECL(pj_status_t) pjmedia_wsola_reset(pjmedia_wsola *wsola, 
     110                                         unsigned options); 
     111 
     112 
     113/** 
    102114 * Give one good frame to WSOLA to be kept as reference. Application 
    103115 * must continuously give WSOLA good frames to keep its session up to 
  • pjproject/trunk/pjmedia/src/pjmedia/wsola.c

    r1829 r1831  
    352352    return PJ_SUCCESS; 
    353353} 
     354 
     355 
     356PJ_DEF(pj_status_t) pjmedia_wsola_reset( pjmedia_wsola *wsola, 
     357                                         unsigned options) 
     358{ 
     359    PJ_ASSERT_RETURN(wsola && options==0, PJ_EINVAL); 
     360    PJ_UNUSED_ARG(options); 
     361 
     362    pjmedia_zero_samples(wsola->buf, wsola->cur_cnt); 
     363    wsola->cur_cnt = (pj_uint16_t)(wsola->hist_cnt +  
     364                                   wsola->samples_per_frame); 
     365    return PJ_SUCCESS; 
     366} 
     367 
    354368 
    355369static void expand(pjmedia_wsola *wsola, unsigned needed) 
Note: See TracChangeset for help on using the changeset viewer.