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);
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;
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.