From 0f5be407f70fa2f7b73e80c9a6f039ad4faa127c Mon Sep 17 00:00:00 2001 From: Andrew Voznytsa Date: Mon, 3 Feb 2020 17:22:41 +0200 Subject: [PATCH] Switch to Qt-way to find number of seconds since 01.01.1970 --- src/VideoStreaming/VideoReceiver.cc | 4 ++-- src/VideoStreaming/VideoReceiver.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/VideoStreaming/VideoReceiver.cc b/src/VideoStreaming/VideoReceiver.cc index e21dca3c8..aecd1fb91 100644 --- a/src/VideoStreaming/VideoReceiver.cc +++ b/src/VideoStreaming/VideoReceiver.cc @@ -959,7 +959,7 @@ VideoReceiver::_videoSinkProbe(GstPad* pad, GstPadProbeInfo* info, gpointer user void VideoReceiver::_noteVideoSinkFrame() { - _lastFrameTime = time(nullptr); + _lastFrameTime = QDateTime::currentSecsSinceEpoch(); } #endif @@ -1033,7 +1033,7 @@ VideoReceiver::_updateTimer() timeout = _videoSettings->rtspTimeout()->rawValue().toUInt(); } - const time_t now = time(nullptr); + const qint64 now = QDateTime::currentSecsSinceEpoch(); if(now - _lastFrameTime > timeout) { stop(); diff --git a/src/VideoStreaming/VideoReceiver.h b/src/VideoStreaming/VideoReceiver.h index b11bbcbb4..f6acdbc8a 100644 --- a/src/VideoStreaming/VideoReceiver.h +++ b/src/VideoStreaming/VideoReceiver.h @@ -138,7 +138,7 @@ protected: GstElement* _pipelineStopRec; GstElement* _videoSink; guint64 _lastFrameId; - time_t _lastFrameTime; + qint64 _lastFrameTime; //-- Wait for Video Server to show up before starting QTimer _frameTimer; -- 2.22.0