]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8864
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 26 Feb 2016 23:42:41 +0000 (17:42 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 26 Feb 2016 23:42:41 +0000 (17:42 -0600)
src/switch_rtp.c

index f111b49dcab2344e43b5c7206d1c9df78c88a2ed..a7e7f9f8aadd2958d29650a1bd7cdb9e4bc989e2 100644 (file)
@@ -7250,7 +7250,12 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
                 */
 
                if (!rtp_session->ts_norm.ts) {
-                       rtp_session->ts_norm.ts = (uint32_t) rand() % 1000000 + 1;
+                       if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_GEN_TS_DELTA)) {
+                               rtp_session->ts_norm.ts = (uint32_t) rand() % 1000000 + 1;
+                       } else {
+                               switch_core_timer_sync(&rtp_session->timer);
+                               rtp_session->ts_norm.ts = rtp_session->timer.samplecount;
+                       }
                }
 
                if (!rtp_session->ts_norm.last_ssrc || send_msg->header.ssrc != rtp_session->ts_norm.last_ssrc) {
@@ -7286,7 +7291,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
                
                rtp_session->ts_norm.last_frame = ntohl(send_msg->header.ts);
                send_msg->header.ts = htonl(rtp_session->ts_norm.ts);
-
+               printf("WTF %d\n", rtp_session->ts_norm.ts);
        }
 
        send_msg->header.ssrc = htonl(rtp_session->ssrc);