Skip to content

Commit 4149abc

Browse files
committed
fix initialization of m_next_frame_time
1 parent b681811 commit 4149abc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

SerialPrograms/Source/CommonFramework/Recording/StreamHistoryTracker_SaveFrames.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ StreamHistoryTracker::StreamHistoryTracker(
216216
, m_has_video(has_video)
217217
, m_target_fps(get_target_fps())
218218
, m_frame_interval(1000000 / m_target_fps)
219+
, m_next_frame_time(WallClock::min())
219220
{
220221
m_worker = Thread([this]{ worker_loop(); });
221222
}
@@ -249,7 +250,7 @@ void StreamHistoryTracker::on_frame(std::shared_ptr<const VideoFrame> frame){
249250
// cout << "on_frame() = " << m_frames.size() << endl;
250251

251252
// Initialize on first frame
252-
if (m_next_frame_time == WallClock{}){
253+
if (m_next_frame_time == WallClock::min()){
253254
m_next_frame_time = frame->timestamp;
254255
}
255256

SerialPrograms/Source/CommonFramework/Recording/StreamHistoryTracker_SaveFrames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ class StreamHistoryTracker{
7575
const bool m_has_video;
7676
size_t m_target_fps;
7777
std::chrono::microseconds m_frame_interval;
78+
WallClock m_next_frame_time;
7879

7980
// We use shared_ptr here so it's fast to snapshot when we need to copy
8081
// everything asynchronously.
8182
std::deque<std::shared_ptr<AudioBlock>> m_audio;
8283
std::deque<std::shared_ptr<const VideoFrame>> m_frames;
8384
std::deque<CompressedVideoFrame> m_compressed_frames;
84-
WallClock m_next_frame_time;
8585

8686
Thread m_worker;
8787
std::atomic<bool> m_stopping{false};

0 commit comments

Comments
 (0)