提交 e205429f 编写于 作者: O Olivier Langlois 提交者: Martin Storsjö

tools: Use av_gettime_relative

Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.
Signed-off-by: NMartin Storsjö <martin@martin.st>
上级 6fdf35fe
......@@ -82,7 +82,7 @@ int main(int argc, char **argv)
goto fail;
}
start_time = av_gettime();
start_time = av_gettime_relative();
while (1) {
uint8_t buf[1024];
int n;
......@@ -93,7 +93,7 @@ int main(int argc, char **argv)
stream_pos += n;
if (bps) {
avio_flush(output);
while ((av_gettime() - start_time) * bps / AV_TIME_BASE < stream_pos)
while ((av_gettime_relative() - start_time) * bps / AV_TIME_BASE < stream_pos)
av_usleep(50 * 1000);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册