diff --git a/libavcodec/vda.c b/libavcodec/vda.c
index 55012ceff51e6af71f766ae6bad7bcb5733f3542..c06b55340aef0d456f2614f2b459a0e26820d684 100644
--- a/libavcodec/vda.c
+++ b/libavcodec/vda.c
@@ -20,6 +20,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <pthread.h>
+#include <CoreFoundation/CFDictionary.h>
+#include <CoreFoundation/CFNumber.h>
+#include <CoreFoundation/CFData.h>
+#include <CoreFoundation/CFString.h>
+
+#include "avcodec.h"
 #include "vda_internal.h"
 
 /**
diff --git a/libavcodec/vda.h b/libavcodec/vda.h
index e28a6a6148c017a7cf3c452c9873b0f257a4254f..9a2af2df80b1330e2ba9f4449ddc099756289402 100644
--- a/libavcodec/vda.h
+++ b/libavcodec/vda.h
@@ -29,9 +29,6 @@
 // http://openradar.appspot.com/8026390
 #undef __GNUC_STDC_INLINE__
 
-#include <pthread.h>
-#include "avcodec.h"
-
 #define Picture QuickdrawPicture
 #include <VideoDecodeAcceleration/VDADecoder.h>
 #undef Picture
diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c
index 3fa5614eacec7afc4a22cc7767b4b920f503f36b..5d624ac13265b77905bb19f7e6a90cc44ef99571 100644
--- a/libavcodec/vda_h264.c
+++ b/libavcodec/vda_h264.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "h264.h"
 #include "vda_internal.h"
 
 static int start_frame(AVCodecContext *avctx,
diff --git a/libavcodec/vda_internal.h b/libavcodec/vda_internal.h
index c6dcaa8ff6123253f291749f3b5fce86ce93f6aa..02c13df72158d0bade7282625e337b9fe19cb315 100644
--- a/libavcodec/vda_internal.h
+++ b/libavcodec/vda_internal.h
@@ -23,16 +23,8 @@
 #ifndef AVCODEC_VDA_INTERNAL_H
 #define AVCODEC_VDA_INTERNAL_H
 
-#include "h264.h"
-#include "h264data.h"
-
 #include "vda.h"
 
-#include <CoreFoundation/CFDictionary.h>
-#include <CoreFoundation/CFNumber.h>
-#include <CoreFoundation/CFData.h>
-#include <CoreFoundation/CFString.h>
-
 /**
  * \addtogroup VDA_Decoding
  *