- Timestamp:
- Jan 7, 2008 6:33:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r1621 r1667 141 141 'A', 'B', 'C', 'D'}; 142 142 143 /* Zero PCM frame */144 #define ZERO_PCM_MAX_SIZE 1920 /* 40ms worth of PCM @ 48KHz */145 static pj_int16_t zero_frame[ZERO_PCM_MAX_SIZE];146 147 148 143 /* 149 144 * Print error. … … 574 569 } 575 570 576 } else if (frame->type != PJMEDIA_FRAME_TYPE_NONE) { 571 /* No need to encode if this is a zero frame. 572 * See http://www.pjsip.org/trac/ticket/439 573 */ 574 } else if (frame->type != PJMEDIA_FRAME_TYPE_NONE && 575 frame->buf != NULL) 576 { 577 577 unsigned ts, codec_samples_per_frame; 578 578 … … 730 730 * silence frame. 731 731 */ 732 if (frame->type == PJMEDIA_FRAME_TYPE_NONE && 733 samples_per_frame <= ZERO_PCM_MAX_SIZE) 734 { 732 if (frame->type == PJMEDIA_FRAME_TYPE_NONE) { 735 733 pj_memcpy(&tmp_zero_frame, frame, sizeof(pjmedia_frame)); 736 734 frame = &tmp_zero_frame; 737 735 738 tmp_zero_frame.buf = zero_frame;736 tmp_zero_frame.buf = NULL; 739 737 tmp_zero_frame.size = samples_per_frame * 2; 740 738 tmp_zero_frame.type = PJMEDIA_FRAME_TYPE_AUDIO; … … 756 754 frame = &tmp_in_frame; 757 755 758 tmp_in_frame.buf = zero_frame;756 tmp_in_frame.buf = NULL; 759 757 tmp_in_frame.size = samples_per_frame * 2; 760 758 tmp_in_frame.type = PJMEDIA_FRAME_TYPE_AUDIO;
Note: See TracChangeset
for help on using the changeset viewer.