mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01: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: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
6fdf35fe35
commit
e205429fcf
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue