+static void set_chunk_tv(int num_frames, int num_chunks, int frequency,
+ struct timeval *result)
+{
+ uint64_t x = (uint64_t)num_frames * 1000 * 1000
+ / frequency / num_chunks;
+
+ result->tv_sec = x / 1000 / 1000;
+ result->tv_usec = x % (1000 * 1000);
+ PARA_INFO_LOG("%d chunks, chunk time: %lums\n", num_chunks,
+ tv2ms(result));
+}
+
+/* Must be called on a frame boundary. */