Changeset 4263
- Timestamp:
- Sep 20, 2012 11:26:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r4255 r4263 74 74 #endif 75 75 76 /* Number of DTMF E bit transmissions */ 77 #define DTMF_EBIT_RETRANSMIT_CNT 3 76 78 77 79 /** … … 95 97 int event; 96 98 pj_uint32_t duration; 99 int ebit_cnt; /**< # of E bit transmissions */ 97 100 }; 98 101 … … 897 900 898 901 digit->duration += PJMEDIA_PIA_SPF(&stream->port.info); 902 if (digit->duration >= PJMEDIA_DTMF_DURATION) 903 digit->duration = PJMEDIA_DTMF_DURATION; 899 904 900 905 event->event = (pj_uint8_t)digit->event; … … 902 907 event->duration = pj_htons((pj_uint16_t)digit->duration); 903 908 904 905 if (forced_last || digit->duration >= PJMEDIA_DTMF_DURATION) { 909 if (forced_last) { 910 digit->duration = PJMEDIA_DTMF_DURATION; 911 } 912 913 if (digit->duration >= PJMEDIA_DTMF_DURATION) { 906 914 907 915 event->e_vol |= 0x80; 908 *last = 1; 909 910 /* Prepare next digit. */ 911 pj_mutex_lock(stream->jb_mutex); 912 913 pj_array_erase(stream->tx_dtmf_buf, sizeof(stream->tx_dtmf_buf[0]), 914 stream->tx_dtmf_count, 0); 915 --stream->tx_dtmf_count; 916 917 pj_mutex_unlock(stream->jb_mutex); 916 917 if (++digit->ebit_cnt >= DTMF_EBIT_RETRANSMIT_CNT) { 918 *last = 1; 919 920 /* Prepare next digit. */ 921 pj_mutex_lock(stream->jb_mutex); 922 923 pj_array_erase(stream->tx_dtmf_buf, sizeof(stream->tx_dtmf_buf[0]), 924 stream->tx_dtmf_count, 0); 925 --stream->tx_dtmf_count; 926 927 pj_mutex_unlock(stream->jb_mutex); 928 } 918 929 } 919 930 … … 1236 1247 * RTP packets. 1237 1248 */ 1238 inc_timestamp = PJMEDIA_DTMF_DURATION - rtp_ts_len; 1249 inc_timestamp = PJMEDIA_DTMF_DURATION + 1250 ((DTMF_EBIT_RETRANSMIT_CNT-1) * samples_per_frame) 1251 - rtp_ts_len; 1239 1252 } 1240 1253 … … 2742 2755 stream->tx_dtmf_buf[stream->tx_dtmf_count+i].event = pt; 2743 2756 stream->tx_dtmf_buf[stream->tx_dtmf_count+i].duration = 0; 2757 stream->tx_dtmf_buf[stream->tx_dtmf_count+i].ebit_cnt = 0; 2744 2758 } 2745 2759
Note: See TracChangeset
for help on using the changeset viewer.