change system time backward will let st-srs behavior abnormal
suzp1984 opened this issue · comments
Root Cause
srs/trunk/3rdparty/st-srs/md.h
Lines 113 to 116 in fa8096a
the default implementation of get timestamp of microseconds is depends on system time.
man gettimeofday
the st-srs
has api that let us to config our own get timestamp function, but srs didn't config it.
srs/trunk/3rdparty/st-srs/sync.c
Lines 57 to 85 in fa8096a
Solutions
refactor MD_GET_UTIME
or Config a time function based on more robust solutions, e.g. system uptime, the timestamp since the system boot.
Version
All version
To Reproduce
Steps to reproduce the behavior:
- Go to 'trunk/3rdparty/st-srs/tools/helloword/'
- run
make
- run
./helloword
- change system time backward, e.g. change system time to one year before;
- check the
Hello
print will stuck.
Expected behavior
Change the system time should not impact the st-srs behavior.
Nice work! Welcome to patch it.