Changeset 457 for pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
- Timestamp:
- May 19, 2006 3:58:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
r438 r457 38 38 #define THIS_FILE "speex_codec.c" 39 39 40 #define DEFAULT_QUALITY 441 #define DEFAULT_COMPLEXITY -140 #define DEFAULT_QUALITY 10 41 #define DEFAULT_COMPLEXITY 10 42 42 43 43 /* Prototypes for Speex factory */ … … 256 256 257 257 /* Somehow quality <=4 is broken in linux. */ 258 if (quality <= 4 ) {259 PJ_LOG( 4,(THIS_FILE, "Adjusting quality to 5 for uwb"));258 if (quality <= 4 && quality >= 0) { 259 PJ_LOG(5,(THIS_FILE, "Adjusting quality to 5 for uwb")); 260 260 spx_factory.speex_param[PARAM_UWB].quality = 5; 261 261 } … … 412 412 attr->setting.lpf =1 ; 413 413 attr->setting.penh =1 ; 414 415 /* Default, set VAD off as it caused voice chip off */ 416 attr->setting.vad = 0; 414 attr->setting.vad = 1; 417 415 418 416 return PJ_SUCCESS; … … 572 570 573 571 /* VAD */ 574 tmp = attr->setting.vad;572 tmp = (attr->setting.vad != 0); 575 573 speex_encoder_ctl(spx->enc, SPEEX_SET_VAD, &tmp); 574 speex_encoder_ctl(spx->enc, SPEEX_SET_DTX, &tmp); 576 575 577 576 /* Complexity */ … … 688 687 pj_int16_t *samp_in; 689 688 unsigned i, samp_count, sz; 689 int tx; 690 690 691 691 spx = (struct spx_private*) codec->codec_data; … … 711 711 712 712 /* Encode the frame */ 713 speex_encode(spx->enc, tmp, &spx->enc_bits); 713 tx = speex_encode(spx->enc, tmp, &spx->enc_bits); 714 715 /* Check if we need not to transmit the frame (DTX) */ 716 if (tx == 0) { 717 output->buf = NULL; 718 output->size = 0; 719 output->timestamp.u64 = input->timestamp.u64; 720 output->type = PJMEDIA_FRAME_TYPE_NONE; 721 return PJ_SUCCESS; 722 } 714 723 715 724 /* Check size. */
Note: See TracChangeset
for help on using the changeset viewer.