diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c
index d789d41afa6a8ed64bc11acca9f2d632da48a8f6..9de1a3b5550d91592d4b9adb9dcf4945ef18c289 100644
--- a/libavdevice/fbdev.c
+++ b/libavdevice/fbdev.c
@@ -39,6 +39,7 @@
 #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 "libavformat/avformat.h"
diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c
index 85f9f0974066777590ce034e2e062825d4b6ac43..7b2ceef1bb650f8a39a283dc019fb8d301dd8a7e 100644
--- a/libavdevice/jack_audio.c
+++ b/libavdevice/jack_audio.c
@@ -27,6 +27,7 @@
 #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 60432c5fc5486cf1e5735b7277f9116673e70dcd..b5fbb318dc5f08a5227a7f75674ee291b40825f1 100644
--- a/libavdevice/oss_audio.c
+++ b/libavdevice/oss_audio.c
@@ -36,6 +36,7 @@
 
 #include "libavutil/log.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/x11grab.c b/libavdevice/x11grab.c
index dd432b3fd55dfac7e2a44e3d3494caa270e86b65..d7c8c8f548f5717f9d4c5d67e29ab4db6ada6690 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -42,6 +42,7 @@
 #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/rtpdec.c b/libavformat/rtpdec.c
index 87d92557db82a6d8858c597266cf15aaa472a5ef..2c5e6c817650243d570eece591fddd14af8b14d2 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -21,6 +21,7 @@
 
 #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 f6f5ac71467c7a1b2a12a6aa19ed6c37b366f591..4cf7a90329e33421a73e661b336f9853209904f8 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -27,6 +27,7 @@
 #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 a3565557d47590cf95d4dc5cf3cd80183fd503ee..a125cc6e9e5430ff57dccebfd8db63d7e5db3b28 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -23,6 +23,7 @@
 #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 c7fb2fa9d96846548d248d63e95ce9f11e4a9423..902076d25dbbf9cfe1613568d37c50b02cb72b3b 100644
--- a/libavformat/rtspenc.c
+++ b/libavformat/rtspenc.c
@@ -31,6 +31,7 @@
 #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 7e84a3fb991bee39c5fec23fe9a052f3461f3ab7..235c71105c79709fa4309caa76c3239d6a53228c 100644
--- a/libavformat/sapenc.c
+++ b/libavformat/sapenc.c
@@ -24,6 +24,7 @@
 #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 156c527e2509c0bb49cd947d8aa30ba894b81975..4d5f4ccaaf2d92e8e9224e21419dc17933cf1067 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -35,6 +35,7 @@
 #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"