[FFmpeg-devel] [PATCH] rename time.h to avtime.h

Michael Niedermayer michaelni at gmx.at
Sat Oct 6 23:50:23 CEST 2012


never include either except form libavutil, theres no need
to include it from outside.

This should fix Ticket1783

The problem was introduced by: ae0a301668da542eaf8855e5dd61d0728181b0dd

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 ffmpeg.c                 |    1 -
 ffplay.c                 |    1 -
 ffserver.c               |    1 -
 libavcodec/dct-test.c    |    1 -
 libavcodec/fft-test.c    |    1 -
 libavcodec/motion-test.c |    1 -
 libavdevice/fbdev.c      |    1 -
 libavdevice/jack_audio.c |    1 -
 libavdevice/oss_audio.c  |    1 -
 libavdevice/x11grab.c    |    1 -
 libavformat/avformat.h   |    1 -
 libavformat/avio.c       |    1 -
 libavformat/hls.c        |    1 -
 libavformat/hlsproto.c   |    1 -
 libavformat/mux.c        |    1 -
 libavformat/rtmphttp.c   |    1 -
 libavformat/rtpdec.c     |    1 -
 libavformat/rtsp.c       |    1 -
 libavformat/rtspdec.c    |    1 -
 libavformat/rtspenc.c    |    1 -
 libavformat/sapenc.c     |    1 -
 libavformat/utils.c      |    1 -
 libavutil/avtime.h       |   41 +++++++++++++++++++++++++++++++++++++++++
 libavutil/avutil.h       |    1 +
 libavutil/des.c          |    1 -
 libavutil/time.c         |    2 +-
 libavutil/time.h         |   41 -----------------------------------------
 tools/aviocat.c          |    1 -
 tools/pktdumper.c        |    1 -
 29 files changed, 43 insertions(+), 67 deletions(-)
 create mode 100644 libavutil/avtime.h
 delete mode 100644 libavutil/time.h

diff --git a/ffmpeg.c b/ffmpeg.c
index 5be745e..d4986a6 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -57,7 +57,6 @@
 #include "libavutil/imgutils.h"
 #include "libavutil/timestamp.h"
 #include "libavutil/bprint.h"
-#include "libavutil/time.h"
 #include "libavformat/os_support.h"
 
 #include "libavformat/ffm.h" // not public API
diff --git a/ffplay.c b/ffplay.c
index d94555a..42f7ae3 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -37,7 +37,6 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/samplefmt.h"
 #include "libavutil/avassert.h"
-#include "libavutil/time.h"
 #include "libavformat/avformat.h"
 #include "libavdevice/avdevice.h"
 #include "libswscale/swscale.h"
diff --git a/ffserver.c b/ffserver.c
index cb7e3ae..5b7c553 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -48,7 +48,6 @@
 #include "libavutil/random_seed.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/opt.h"
-#include "libavutil/time.h"
 
 #include <stdarg.h>
 #include <unistd.h>
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 6cefd9d..b3553d4 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -37,7 +37,6 @@
 #include "libavutil/cpu.h"
 #include "libavutil/common.h"
 #include "libavutil/lfg.h"
-#include "libavutil/time.h"
 
 #include "simple_idct.h"
 #include "aandcttab.h"
diff --git a/libavcodec/fft-test.c b/libavcodec/fft-test.c
index 66474ce..a13fa7f 100644
--- a/libavcodec/fft-test.c
+++ b/libavcodec/fft-test.c
@@ -27,7 +27,6 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/lfg.h"
 #include "libavutil/log.h"
-#include "libavutil/time.h"
 #include "fft.h"
 #if CONFIG_FFT_FLOAT
 #include "dct.h"
diff --git a/libavcodec/motion-test.c b/libavcodec/motion-test.c
index 3504ccf..eb0722d 100644
--- a/libavcodec/motion-test.c
+++ b/libavcodec/motion-test.c
@@ -32,7 +32,6 @@
 #include "libavutil/internal.h"
 #include "libavutil/lfg.h"
 #include "libavutil/mem.h"
-#include "libavutil/time.h"
 
 #undef printf
 
diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index d977495..f9b452f 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -39,7 +39,6 @@
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
-#include "libavutil/time.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/pixdesc.h"
 #include "avdevice.h"
diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c
index bd6a770..3eb883e 100644
--- a/libavdevice/jack_audio.c
+++ b/libavdevice/jack_audio.c
@@ -27,7 +27,6 @@
 #include "libavutil/log.h"
 #include "libavutil/fifo.h"
 #include "libavutil/opt.h"
-#include "libavutil/time.h"
 #include "libavcodec/avcodec.h"
 #include "libavformat/avformat.h"
 #include "libavformat/internal.h"
diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c
index 5c8b3b9..000980d 100644
--- a/libavdevice/oss_audio.c
+++ b/libavdevice/oss_audio.c
@@ -36,7 +36,6 @@
 
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
-#include "libavutil/time.h"
 #include "libavcodec/avcodec.h"
 #include "avdevice.h"
 #include "libavformat/internal.h"
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index b6bd486..b244ded 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -41,7 +41,6 @@
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
-#include "libavutil/time.h"
 #include <time.h>
 #include <X11/X.h>
 #include <X11/Xlib.h>
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 1ee44df..61b2374 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -202,7 +202,6 @@
 #include "libavformat/version.h"
 
 #if FF_API_AV_GETTIME
-#include "libavutil/time.h"
 #endif
 
 struct AVFormatContext;
diff --git a/libavformat/avio.c b/libavformat/avio.c
index abc7072..4cf2a7d 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -22,7 +22,6 @@
 #include "libavutil/avstring.h"
 #include "libavutil/dict.h"
 #include "libavutil/opt.h"
-#include "libavutil/time.h"
 #include "os_support.h"
 #include "avformat.h"
 #if CONFIG_NETWORK
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 1f5309b..1e692a6 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -30,7 +30,6 @@
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/dict.h"
-#include "libavutil/time.h"
 #include "avformat.h"
 #include "internal.h"
 #include "avio_internal.h"
diff --git a/libavformat/hlsproto.c b/libavformat/hlsproto.c
index a290c88..7728984 100644
--- a/libavformat/hlsproto.c
+++ b/libavformat/hlsproto.c
@@ -26,7 +26,6 @@
  */
 
 #include "libavutil/avstring.h"
-#include "libavutil/time.h"
 #include "avformat.h"
 #include "internal.h"
 #include "url.h"
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 48f4d77..e5e7551 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -36,7 +36,6 @@
 #include "libavutil/avstring.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/parseutils.h"
-#include "libavutil/time.h"
 #include "riff.h"
 #include "audiointerleave.h"
 #include "url.h"
diff --git a/libavformat/rtmphttp.c b/libavformat/rtmphttp.c
index d21ac67..e9645d7 100644
--- a/libavformat/rtmphttp.c
+++ b/libavformat/rtmphttp.c
@@ -27,7 +27,6 @@
 #include "libavutil/avstring.h"
 #include "libavutil/intfloat.h"
 #include "libavutil/opt.h"
-#include "libavutil/time.h"
 #include "internal.h"
 #include "http.h"
 #include "rtmp.h"
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index e044435..9237be5 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -21,7 +21,6 @@
 
 #include "libavutil/mathematics.h"
 #include "libavutil/avstring.h"
-#include "libavutil/time.h"
 #include "libavcodec/get_bits.h"
 #include "avformat.h"
 #include "mpegts.h"
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 80f1047..4463999 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -28,7 +28,6 @@
 #include "libavutil/random_seed.h"
 #include "libavutil/dict.h"
 #include "libavutil/opt.h"
-#include "libavutil/time.h"
 #include "avformat.h"
 #include "avio_internal.h"
 
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 856be56..491837d 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -23,7 +23,6 @@
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/random_seed.h"
-#include "libavutil/time.h"
 #include "avformat.h"
 
 #include "internal.h"
diff --git a/libavformat/rtspenc.c b/libavformat/rtspenc.c
index bad6fbd..63cf975 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -31,7 +31,6 @@
 #include "avio_internal.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/avstring.h"
-#include "libavutil/time.h"
 #include "url.h"
 
 #define SDP_MAX_SIZE 16384
diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c
index 3de615d..7ac43d8 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -24,7 +24,6 @@
 #include "libavutil/random_seed.h"
 #include "libavutil/avstring.h"
 #include "libavutil/intreadwrite.h"
-#include "libavutil/time.h"
 #include "internal.h"
 #include "network.h"
 #include "os_support.h"
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 69ad761..61940ed 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -37,7 +37,6 @@
 #include "libavutil/avstring.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/parseutils.h"
-#include "libavutil/time.h"
 #include "libavutil/timestamp.h"
 #include "riff.h"
 #include "audiointerleave.h"
diff --git a/libavutil/avtime.h b/libavutil/avtime.h
new file mode 100644
index 0000000..90eb436
--- /dev/null
+++ b/libavutil/avtime.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2000-2003 Fabrice Bellard
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_TIME_H
+#define AVUTIL_TIME_H
+
+#include <stdint.h>
+
+/**
+ * Get the current time in microseconds.
+ */
+int64_t av_gettime(void);
+
+/**
+ * Sleep for a period of time.  Although the duration is expressed in
+ * microseconds, the actual delay may be rounded to the precision of the
+ * system timer.
+ *
+ * @param  usec Number of microseconds to sleep.
+ * @return zero on success or (negative) error code.
+ */
+int av_usleep(unsigned usec);
+
+#endif /* AVUTIL_TIME_H */
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index cd02b35..1b6320d 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -279,6 +279,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
 #include "intfloat_readwrite.h"
 #include "log.h"
 #include "pixfmt.h"
+#include "avtime.h"
 
 /**
  * Return x default pointer in case p is NULL.
diff --git a/libavutil/des.c b/libavutil/des.c
index 32ac26f..63a3a1d 100644
--- a/libavutil/des.c
+++ b/libavutil/des.c
@@ -343,7 +343,6 @@ void av_des_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count) {
 #undef srand
 #include <stdlib.h>
 #include <stdio.h>
-#include "libavutil/time.h"
 static uint64_t rand64(void) {
     uint64_t r = rand();
     r = (r << 32) | rand();
diff --git a/libavutil/time.c b/libavutil/time.c
index 27feb0b..ba29c4b 100644
--- a/libavutil/time.c
+++ b/libavutil/time.c
@@ -33,7 +33,7 @@
 #include <windows.h>
 #endif
 
-#include "libavutil/time.h"
+#include "avutil.h"
 #include "error.h"
 
 int64_t av_gettime(void)
diff --git a/libavutil/time.h b/libavutil/time.h
deleted file mode 100644
index 90eb436..0000000
--- a/libavutil/time.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_TIME_H
-#define AVUTIL_TIME_H
-
-#include <stdint.h>
-
-/**
- * Get the current time in microseconds.
- */
-int64_t av_gettime(void);
-
-/**
- * Sleep for a period of time.  Although the duration is expressed in
- * microseconds, the actual delay may be rounded to the precision of the
- * system timer.
- *
- * @param  usec Number of microseconds to sleep.
- * @return zero on success or (negative) error code.
- */
-int av_usleep(unsigned usec);
-
-#endif /* AVUTIL_TIME_H */
diff --git a/tools/aviocat.c b/tools/aviocat.c
index 52a96bd..686907b 100644
--- a/tools/aviocat.c
+++ b/tools/aviocat.c
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "libavutil/time.h"
 #include "libavformat/avformat.h"
 
 static int usage(const char *argv0, int ret)
diff --git a/tools/pktdumper.c b/tools/pktdumper.c
index 920397b..28f540e 100644
--- a/tools/pktdumper.c
+++ b/tools/pktdumper.c
@@ -34,7 +34,6 @@
 #define FILENAME_BUF_SIZE 4096
 
 #include "libavutil/avstring.h"
-#include "libavutil/time.h"
 #include "libavformat/avformat.h"
 
 #define PKTFILESUFF "_%08" PRId64 "_%02d_%010" PRId64 "_%06d_%c.bin"
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list