1. 24 Oct, 2014 1 commit
    • Martin Storsjö's avatar
      lavu: Add av_gettime_relative · 1bd0bdcd
      Martin Storsjö authored
      Since av_gettime() is used in a number of places where actual
      real time clock is required, the monotonic clock introduced in
      ebef9f5a would have consequences that are hard to handle. Instead
      split it into a separate function that can be used in the cases
      where only relative time is desired.
      
      On platform where no monotonic clock is available, the difference
      between the two av_gettime functions is not clear, and one could
      mistakenly use the relative clock where an absolute one is
      required. Therefore add an offset, to make it evident that the
      time returned from av_gettime_relative never is actual current
      real time, even though it is based on av_gettime.
      
      Based on a patch by Olivier Langlois.
      Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
      1bd0bdcd
  2. 17 May, 2014 1 commit
    • Olivier Langlois's avatar
      lavu: add av_gettime_relative() · 0eec06ed
      Olivier Langlois authored
      These functions are using the POSIX clock_gettime() function with the
      CLOCK_MONOTONIC clock id. If these are not present on the targeted
      platform, the new functions will fallback on using the original realtime functions
      av_gettime() and av_usleep().
      
      Monotonic support can be added on other platforms with their
      equivalent native system API eventually if possible.
      
      Whenever time is requested to measure relative time, the monotonic clock,
      when available, is superior to the system realtime clock because it is
      not affected by discontinuous jumps in the system time
      
      In a future step, offering the flexibility to let the user choose between
      rt and monotonic clock for avdevices packets will be investigated.
      
      It is very easy to experience the issues that this patch attempt to address
      by rewinding back in the past the system time while ffmpeg is running.
      
      this is breaking the ffmpeg report printing (ffmepg.c:print_report()) and
      the the rate emulator functionality (-re) without the patch.
      Signed-off-by: 's avatarOlivier Langlois <olivier@trillion01.com>
      Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
      0eec06ed
  3. 22 Jun, 2012 1 commit
    • Mans Rullgard's avatar
      lavu: add av_usleep() function · d3d3a32c
      Mans Rullgard authored
      This function implements a delay using the first available
      of the following functions:
      
      - nanosleep()
      - usleep()
      - Sleep() (Windows)
      
      The conditional #includes in time.c are simplified by including
      unistd.h and windows.h whenever they are available rather than
      having these lines triggered by specific functions.
      Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
      d3d3a32c
  4. 20 Jun, 2012 2 commits
  5. 17 May, 2011 1 commit
  6. 19 Mar, 2011 1 commit
  7. 09 Sep, 2010 1 commit
  8. 08 Sep, 2010 1 commit
  9. 22 Dec, 2008 1 commit
  10. 12 Aug, 2008 1 commit
  11. 09 May, 2008 1 commit
  12. 08 May, 2008 1 commit
  13. 16 May, 2007 1 commit
  14. 07 Oct, 2006 1 commit
  15. 18 Aug, 2006 1 commit
  16. 08 Mar, 2006 1 commit