summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-06-20 01:24:39 +0100
committerMans Rullgard <mans@mansr.com>2012-06-20 17:09:03 +0100
commitae0a301668da542eaf8855e5dd61d0728181b0dd (patch)
tree7910f895668b75a8b7e0843dfe70e3ebf7172b01 /libavformat
parentdb7d8fb4ef950329745224d49c8d4fb4174baa22 (diff)
Move av_gettime() to libavutil
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avformat.h5
-rw-r--r--libavformat/utils.c10
-rw-r--r--libavformat/version.h3
3 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 040e35eb92..1c1aad652f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1635,10 +1635,9 @@ void av_dump_format(AVFormatContext *ic,
const char *url,
int is_output);
-/**
- * Get the current time in microseconds.
- */
+#if FF_API_AV_GETTIME
int64_t av_gettime(void);
+#endif
/**
* Return in 'buf' the path with '%d' replaced by a number.
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5450dc4bff..156c527e25 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -38,8 +38,6 @@
#include "riff.h"
#include "audiointerleave.h"
#include "url.h"
-#include <sys/time.h>
-#include <time.h>
#include <stdarg.h>
#if CONFIG_NETWORK
#include "network.h"
@@ -3411,12 +3409,12 @@ void av_dump_format(AVFormatContext *ic,
av_free(printed);
}
-int64_t av_gettime(void)
+#if FF_API_AV_GETTIME && CONFIG_SHARED && HAVE_SYMVER
+FF_SYMVER(int64_t, av_gettime, (void), "LIBAVFORMAT_54")
{
- struct timeval tv;
- gettimeofday(&tv,NULL);
- return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
+ return av_gettime();
}
+#endif
uint64_t ff_ntp_time(void)
{
diff --git a/libavformat/version.h b/libavformat/version.h
index 2216e4eabd..29e520534c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -59,5 +59,8 @@
#ifndef FF_API_INTERLEAVE_PACKET
#define FF_API_INTERLEAVE_PACKET (LIBAVFORMAT_VERSION_MAJOR < 55)
#endif
+#ifndef FF_API_AV_GETTIME
+#define FF_API_AV_GETTIME (LIBAVFORMAT_VERSION_MAJOR < 55)
+#endif
#endif /* AVFORMAT_VERSION_H */