1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Olivier Langlois 2014-05-06 17:16:50 -04:00 committed by Michael Niedermayer
parent b052bccbe4
commit 41120e6e40

View File

@ -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);
}
}