diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 2871f21a9f5c26af6f132d357fc190169cde9226..9d5c1637214193057a038eef120bb14e33421876 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -20,6 +20,7 @@
  */
 #include "avformat.h"
 
+#include <sys/time.h>
 #include <unistd.h> /* for select() prototype */
 #include "network.h"