avsync-lib: handle pts wrapping in vmaster mode [1/1]

PD#OTT-51344

Problem:
When vdisc happens, current system time is reset in kernel, but
frame_expire still keeps the old one. As a result, last system time
is locked to a big value and prevent future rendering with smaller
PTS.

Solution:
Reset system time and last_r_syst when vdisc is triggered under vmaster
mode.

Verify:
SBT-Unn

Change-Id: I3eb03f83b7755d3c370249362da4f8d30324af27
Signed-off-by: <song.zhao@amlogic.com>
diff --git a/src/avsync.c b/src/avsync.c
index c614355..8fb63e3 100644
--- a/src/avsync.c
+++ b/src/avsync.c
@@ -970,11 +970,16 @@
                 avsync->session_id, systime, fpts);
             msync_session_set_video_dis(avsync->fd, fpts);
             avsync->last_disc_pts = fpts;
+            if (avsync->mode == AV_SYNC_MODE_VMASTER) {
+                systime = fpts;
+                avsync->last_r_syst = -1;
+            }
         }
 
         if ((int)(systime - fpts) > 0) {
             if ((int)(systime - fpts) < avsync->disc_thres_max) {
                 /* catch up PCR */
+                avsync->last_r_syst = -1;
                 return true;
             } else {
                 /* render according to FPS */