mgcp: Move Annex A counting out of patch/count method
mgcp_patch_and_count has grown due supporting linearizing timestamps,
ssrc and other things for equipment like the ip.access nanoBTS. Fight
back and move the Annex A code into a dedicated method.
The result is updated as we now count after all the patching and for
the Annex A code no change in SSRC can be detected.
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index a057503..e145c6a 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -699,10 +699,10 @@
memset(&state, 0, sizeof(state));
memset(&rtp, 0, sizeof(rtp));
- state.initialized = 1;
- state.base_seq = pl_test_dat[i].base_seq;
- state.out_stream.last_seq = pl_test_dat[i].max_seq;
- state.cycles = pl_test_dat[i].cycles;
+ state.stats_initialized = 1;
+ state.stats_base_seq = pl_test_dat[i].base_seq;
+ state.stats_max_seq = pl_test_dat[i].max_seq;
+ state.stats_cycles = pl_test_dat[i].cycles;
rtp.packets = pl_test_dat[i].packets;
mgcp_state_calc_loss(&state, &rtp, &expected, &loss);
@@ -921,7 +921,7 @@
state.out_stream.err_ts_counter - last_out_ts_err_cnt);
printf("Stats: Jitter = %u, Transit = %d\n",
- mgcp_state_calc_jitter(&state), state.transit);
+ mgcp_state_calc_jitter(&state), state.stats_transit);
last_in_ts_err_cnt = state.in_stream.err_ts_counter;
last_out_ts_err_cnt = state.out_stream.err_ts_counter;