X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=fake_capture.cpp;h=2ef1d7d68dc58b71a2c2cd93a76efd0f5473d536;hb=aac15101d9cc85681eee3e02c960d57e32414db6;hp=29b06b100d016d49543114c0056a6c31e4bf05dd;hpb=1833f747a9008f38e5597622f2e3dbce3340e2cb;p=bmusb diff --git a/fake_capture.cpp b/fake_capture.cpp index 29b06b1..2ef1d7d 100644 --- a/fake_capture.cpp +++ b/fake_capture.cpp @@ -238,6 +238,7 @@ void FakeCapture::producer_thread_func() next_frame = now; } } + steady_clock::time_point timestamp = steady_clock::now(); // Figure out when the next frame is to be, then compute the current one. add_time(1.0 / fps, &next_frame); @@ -262,7 +263,7 @@ void FakeCapture::producer_thread_func() memset4(video_frame.data, ycbcr, width * height / 2); } video_frame.len = width * height * 2; - video_frame.received_timestamp = steady_clock::now(); + video_frame.received_timestamp = timestamp; } AudioFormat audio_format; @@ -274,7 +275,7 @@ void FakeCapture::producer_thread_func() const unsigned num_stereo_samples = audio_sample_frequency / fps; assert(audio_frame.size >= audio_format.num_channels * sizeof(int32_t) * num_stereo_samples); audio_frame.len = audio_format.num_channels * sizeof(int32_t) * num_stereo_samples; - audio_frame.received_timestamp = steady_clock::now(); + audio_frame.received_timestamp = timestamp; if (audio_sin == 0.0f) { // Silence.