summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--module_test/src/gtest_sapp_ipv4_plug.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/module_test/src/gtest_sapp_ipv4_plug.cpp b/module_test/src/gtest_sapp_ipv4_plug.cpp
index 9937aa9..e71ab0e 100644
--- a/module_test/src/gtest_sapp_ipv4_plug.cpp
+++ b/module_test/src/gtest_sapp_ipv4_plug.cpp
@@ -107,6 +107,8 @@ extern "C" char ipv4_frag_assemble_checksum(const struct streaminfo *pstream,
}
#include "../../include/private/sapp_private_api.h"
+extern volatile long long g_monotonic_time_ms;
+extern volatile time_t g_monotonic_time;
extern volatile long long g_current_time_ms;
extern volatile time_t g_current_time;
/* If the Real World time is used, the time difference may be inaccurate due to overload CPU resources, operating system scheduling or other issues. */
@@ -140,17 +142,26 @@ extern "C" char iplayer_readjust_time_entry(const struct streaminfo *pstream, un
first_pkt_stamp.tv_usec = cur_pkt_stamp.tv_usec;
g_current_time_ms = 0; // set time to PanGu
g_current_time = 0; // set time to PanGu
+ g_monotonic_time_ms=g_current_time_ms;
+ g_monotonic_time=g_current_time;
return APP_STATE_GIVEME;
}
g_current_time_ms = ((long)cur_pkt_stamp.tv_sec * 1000 + cur_pkt_stamp.tv_usec / 1000) - ((long)first_pkt_stamp.tv_sec * 1000 + first_pkt_stamp.tv_usec / 1000);
g_current_time = g_current_time_ms / 1000;
+ g_monotonic_time_ms=g_current_time_ms;
+ g_monotonic_time=g_current_time;
return APP_STATE_GIVEME;
}
extern "C" char timer_add_1s_polling_entry(struct streaminfo *stream , void **pme , int thread_seq ,void *a_packet )
{
- if(g_current_time_ms >= 0)g_current_time_ms+=1000;
+ if(g_current_time_ms >= 0)
+ {
+ g_current_time_ms+=1000;
+ g_monotonic_time_ms=g_current_time_ms;
+ g_monotonic_time=g_current_time;
+ }
return POLLING_STATE_IDLE;
}