FreeCalypso > hg > rtp-debug-utils
comparison rtp-gsmfr-dump.c @ 5:7c85a7a913f7
rtp-gsmfr-dump: treat stream discontinuities as non-fatal
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 12 May 2023 06:46:46 +0000 |
parents | 50aa973a91ef |
children |
comparison
equal
deleted
inserted
replaced
4:5216e7fb1c9e | 5:7c85a7a913f7 |
---|---|
69 (rtp_hdr[6] << 8) | rtp_hdr[7]; | 69 (rtp_hdr[6] << 8) | rtp_hdr[7]; |
70 cur_ssrc = (rtp_hdr[8] << 24) | (rtp_hdr[9] << 16) | | 70 cur_ssrc = (rtp_hdr[8] << 24) | (rtp_hdr[9] << 16) | |
71 (rtp_hdr[10] << 8) | rtp_hdr[11]; | 71 (rtp_hdr[10] << 8) | rtp_hdr[11]; |
72 if (stream_init_flag) { | 72 if (stream_init_flag) { |
73 if (cur_ssrc != stream_ssrc) { | 73 if (cur_ssrc != stream_ssrc) { |
74 fprintf(stderr, | 74 printf( |
75 "error in packet #%u: SSRC change from 0x%08X to 0x%08X\n", | 75 "error in packet #%u: SSRC change from 0x%08X to 0x%08X\n", |
76 pkt_idx, stream_ssrc, cur_ssrc); | 76 pkt_idx, stream_ssrc, cur_ssrc); |
77 exit(1); | 77 } else if (cur_seq != last_seq + 1 && |
78 } | 78 (cur_seq != 0 || last_seq != 0xFFFF)) { |
79 if (cur_seq != last_seq + 1 && | 79 printf( |
80 (cur_seq != 0 || last_seq != 0xFFFF)) { | |
81 fprintf(stderr, | |
82 "error in packet #%u: seq break from 0x%04X to 0x%04X\n", | 80 "error in packet #%u: seq break from 0x%04X to 0x%04X\n", |
83 pkt_idx, last_seq, cur_seq); | 81 pkt_idx, last_seq, cur_seq); |
84 exit(1); | 82 } else if (cur_tstamp != last_tstamp + 160) { |
85 } | 83 printf( |
86 if (cur_tstamp != last_tstamp + 160) { | |
87 fprintf(stderr, | |
88 "error in packet #%u: timestamp break from 0x%08X to 0x%08X\n", | 84 "error in packet #%u: timestamp break from 0x%08X to 0x%08X\n", |
89 pkt_idx, last_tstamp, cur_tstamp); | 85 pkt_idx, last_tstamp, cur_tstamp); |
90 exit(1); | |
91 } | 86 } |
92 } else { | 87 } else |
93 stream_init_flag = 1; | 88 stream_init_flag = 1; |
94 stream_ssrc = cur_ssrc; | |
95 } | |
96 last_seq = cur_seq; | 89 last_seq = cur_seq; |
97 last_tstamp = cur_tstamp; | 90 last_tstamp = cur_tstamp; |
91 stream_ssrc = cur_ssrc; | |
98 } | 92 } |
99 | 93 |
100 static void | 94 static void |
101 process_payload(payload, payload_len) | 95 process_payload(payload, payload_len) |
102 u_char *payload; | 96 u_char *payload; |