summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--video.c12
2 files changed, 7 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a8d0768..782ac89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
User johns
Date:
+ CLOCK_REALTIME -> CLOCK_MONOTONIC to allow time changes.
Add function VideoStreamOpen and always use VideoStreamClose.
Softer audio/video sync.
Add function GetStats to the video output module.
diff --git a/video.c b/video.c
index 1e1ad8c..6893963 100644
--- a/video.c
+++ b/video.c
@@ -3491,7 +3491,7 @@ static void VaapiBlackSurface(VaapiDecoder * decoder)
VA_FRAME_PICTURE)) != VA_STATUS_SUCCESS) {
Error(_("video/vaapi: vaPutSurface failed %d\n"), status);
}
- clock_gettime(CLOCK_REALTIME, &decoder->FrameTime);
+ clock_gettime(CLOCK_MONOTONIC, &decoder->FrameTime);
put1 = GetMsTicks();
if (put1 - sync > 2000) {
@@ -4731,7 +4731,7 @@ static void VaapiDisplayFrame(void)
put2 = put1;
#endif
}
- clock_gettime(CLOCK_REALTIME, &nowtime);
+ clock_gettime(CLOCK_MONOTONIC, &nowtime);
// FIXME: 31 only correct for 50Hz
if ((nowtime.tv_sec - decoder->FrameTime.tv_sec)
* 1000 * 1000 * 1000 + (nowtime.tv_nsec -
@@ -5159,7 +5159,7 @@ static void VaapiDisplayHandlerThread(void)
}
}
- clock_gettime(CLOCK_REALTIME, &nowtime);
+ clock_gettime(CLOCK_MONOTONIC, &nowtime);
// time for one frame over?
if ((nowtime.tv_sec - decoder->FrameTime.tv_sec)
* 1000 * 1000 * 1000 + (nowtime.tv_nsec - decoder->FrameTime.tv_nsec) <
@@ -8382,7 +8382,7 @@ static void VdpauDisplayFrame(void)
VdpauGetErrorString(status));
}
// FIXME: CLOCK_MONOTONIC_RAW
- clock_gettime(CLOCK_REALTIME, &VdpauFrameTime);
+ clock_gettime(CLOCK_MONOTONIC, &VdpauFrameTime);
for (i = 0; i < VdpauDecoderN; ++i) {
// remember time of last shown surface
VdpauDecoders[i]->FrameTime = VdpauFrameTime;
@@ -8884,7 +8884,7 @@ static void VdpauDisplayHandlerThread(void)
usleep(5 * 1000);
}
- clock_gettime(CLOCK_REALTIME, &nowtime);
+ clock_gettime(CLOCK_MONOTONIC, &nowtime);
// time for one frame over?
if ((nowtime.tv_sec - VdpauFrameTime.tv_sec) * 1000 * 1000 * 1000 +
(nowtime.tv_nsec - VdpauFrameTime.tv_nsec) < 15 * 1000 * 1000) {
@@ -8893,7 +8893,7 @@ static void VdpauDisplayHandlerThread(void)
if (VdpauPreemption) { // display preempted
if (VdpauPreemptionRecover()) {
- clock_gettime(CLOCK_REALTIME, &VdpauFrameTime);
+ clock_gettime(CLOCK_MONOTONIC, &VdpauFrameTime);
return;
}
}