avsync-lib: disable sync threshold in kernel
It will avoid VIDEO_START to touch the PCR clock, or there will be a
sudden clock jump.
Change-Id: I6fa93b68512c41f0a1839dd220eeac53de0e32e6
diff --git a/avsync-lib/src/avsync.c b/avsync-lib/src/avsync.c
index f83590a..dda289f 100644
--- a/avsync-lib/src/avsync.c
+++ b/avsync-lib/src/avsync.c
@@ -268,6 +268,8 @@
log_error("set pcrmaster mode fail");
}
+ /* video start ASAP */
+ tsync_set_video_sync_thres(avsync->session_id, false);
/* video start event */
if (tsync_send_video_start(avsync->session_id, frame->pts))
log_error("send video start fail");
diff --git a/avsync-lib/src/tsync.c b/avsync-lib/src/tsync.c
index 4e509d8..b17d7b8 100644
--- a/avsync-lib/src/tsync.c
+++ b/avsync-lib/src/tsync.c
@@ -27,6 +27,7 @@
#define TSYNC_MODE "/sys/class/tsync/mode"
#define _A_M 'S'
+#define AMSTREAM_IOC_SYNCTHRESH _IOW((_A_M), 0x19, int)
#define AMSTREAM_IOC_SET_VSYNC_UPINT _IOW((_A_M), 0x89, int)
#define AMSTREAM_IOC_SET_VIDEOPEEK _IOW(_A_M, 0xbf, unsigned int)
@@ -154,6 +155,11 @@
return video_device_ioctl(AMSTREAM_IOC_SET_VSYNC_UPINT, enable);
}
+int tsync_set_video_sync_thres(int session, bool enable)
+{
+ return video_device_ioctl(AMSTREAM_IOC_SYNCTHRESH, enable);
+}
+
int tsync_set_mode(int session, enum sync_mode mode)
{
const char* val = NULL;
diff --git a/avsync-lib/src/tsync.h b/avsync-lib/src/tsync.h
index 52bd953..7d97269 100644
--- a/avsync-lib/src/tsync.h
+++ b/avsync-lib/src/tsync.h
@@ -25,5 +25,6 @@
int tsync_set_pts_inc_mode(int session, bool enable);
int tsync_set_mode(int session, enum sync_mode mode);
int tsync_set_video_peek_mode(int session);
+int tsync_set_video_sync_thres(int session, bool enable);
#endif