[FFmpeg-cvslog] tools: Use av_gettime_relative()

Olivier Langlois git at videolan.org
Sat May 17 15:57:28 CEST 2014


ffmpeg | branch: master | Olivier Langlois <olivier at trillion01.com> | Tue May  6 17:16:50 2014 -0400| [41120e6e40e34a840d194883a95c57a6e91b1093] | committer: Michael Niedermayer

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 at trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41120e6e40e34a840d194883a95c57a6e91b1093
---

 tools/aviocat.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/aviocat.c b/tools/aviocat.c
index 56b918e..3bd62b7 100644
--- a/tools/aviocat.c
+++ b/tools/aviocat.c
@@ -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);
         }
     }



More information about the ffmpeg-cvslog mailing list