Skip to content
Snippets Groups Projects

Rewrote dump_video example to prefer clock_gettime() over ftime().

Merged Petter Reinholdtsen requested to merge ftime2gettimeofday into master

The ftime method has been removed from POSIX and is depricated on Linux. clock_gettime() work better on Linux, but is not available on Windows, so fall back to ftime() if autotools/scons fail to detect clock_gettime().

Based on proposal in opusfile!9 (closed).

Fixes the following compiler messages:

../../examples/dump_video.c: In function ‘main’:
../../examples/dump_video.c:490:5: warning: ‘ftime’ is deprecated: Use gettimeofday or clock_gettime instead [-Werror=deprecated-declarations]
  490 |     ftime(&start);
      |     ^~~~~
In file included from ../../examples/dump_video.c:40:
/usr/include/x86_64-linux-gnu/sys/timeb.h:29:12: note: declared here
   29 | extern int ftime (struct timeb *__timebuf)
      |            ^~~~~
../../examples/dump_video.c:491:5: warning: ‘ftime’ is deprecated: Use gettimeofday or clock_gettime instead [-Werror=deprecated-declarations]
  491 |     ftime(&last);
      |     ^~~~~
/usr/include/x86_64-linux-gnu/sys/timeb.h:29:12: note: declared here
   29 | extern int ftime (struct timeb *__timebuf)
      |            ^~~~~
../../examples/dump_video.c:505:13: warning: ‘ftime’ is deprecated: Use gettimeofday or clock_gettime instead [-Werror=deprecated-declarations]
  505 |             ftime(&after);
      |             ^~~~~
/usr/include/x86_64-linux-gnu/sys/timeb.h:29:12: note: declared here
   29 | extern int ftime (struct timeb *__timebuf)
      |            ^~~~~
Edited by Petter Reinholdtsen

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading