--- a/metadata.c
+++ b/metadata.c
@@ -15,6 +15,8 @@
  * You should have received a copy of the GNU General Public License
  * along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
  */
+#include "config.h"
+
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
@@ -26,7 +28,6 @@
 #include <sys/param.h>
 #include <fcntl.h>
 
-#include "config.h"
 #include <libexif/exif-loader.h>
 #include "image_utils.h"
 #include "tagutils/tagutils.h"
@@ -170,7 +171,7 @@
 #define MPEG_TS_PACKET_LENGTH 188
 #define MPEG_TS_PACKET_LENGTH_DLNA 192 /* prepends 4 bytes to TS packet */
 int
-dlna_timestamp_is_present(const char * filename, int * raw_packet_size)
+dlna_timestamp_is_present(const char *filename, int *raw_packet_size)
 {
 	unsigned char buffer[3*MPEG_TS_PACKET_LENGTH_DLNA];
 	int fd, i;
@@ -211,7 +212,7 @@
 
 #ifdef TIVO_SUPPORT
 int
-is_tivo_file(const char * path)
+is_tivo_file(const char *path)
 {
 	unsigned char buf[5];
 	unsigned char hdr[5] = { 'T','i','V','o','\0' };
@@ -230,7 +231,7 @@
 #endif
 
 void
-check_for_captions(const char * path, sqlite_int64 detailID)
+check_for_captions(const char *path, int64_t detailID)
 {
 	char *file = malloc(MAXPATHLEN);
 	char *id = NULL;
@@ -270,7 +271,7 @@
 }
 
 void
-parse_nfo(const char * path, metadata_t * m)
+parse_nfo(const char *path, metadata_t *m)
 {
 	FILE *nfo;
 	char buf[65536];
@@ -321,7 +322,7 @@
 }
 
 void
-free_metadata(metadata_t * m, uint32_t flags)
+free_metadata(metadata_t *m, uint32_t flags)
 {
 	if( flags & FLAG_TITLE )
 		free(m->title);
@@ -357,8 +358,8 @@
 		free(m->rotation);
 }
 
-sqlite_int64
-GetFolderMetadata(const char * name, const char * path, const char * artist, const char * genre, sqlite_int64 album_art)
+int64_t
+GetFolderMetadata(const char *name, const char *path, const char *artist, const char *genre, int64_t album_art)
 {
 	int ret;
 
@@ -375,16 +376,16 @@
 	return ret;
 }
 
-sqlite_int64
-GetAudioMetadata(const char * path, char * name)
+int64_t
+GetAudioMetadata(const char *path, char *name)
 {
 	char type[4];
 	static char lang[6] = { '\0' };
 	struct stat file;
-	sqlite_int64 ret;
+	int64_t ret;
 	char *esc_tag;
 	int i;
-	sqlite_int64 album_art = 0;
+	int64_t album_art = 0;
 	struct song_metadata song;
 	metadata_t m;
 	uint32_t free_flags = FLAG_MIME|FLAG_DURATION|FLAG_DLNA_PN|FLAG_DATE;
@@ -580,8 +581,8 @@
 	return;
 }
 
-sqlite_int64
-GetImageMetadata(const char * path, char * name)
+int64_t
+GetImageMetadata(const char *path, char *name)
 {
 	ExifData *ed;
 	ExifEntry *e = NULL;
@@ -593,8 +594,8 @@
 	char make[32], model[64] = {'\0'};
 	char b[1024];
 	struct stat file;
-	sqlite_int64 ret;
-	image_s * imsrc;
+	int64_t ret;
+	image_s *imsrc;
 	metadata_t m;
 	uint32_t free_flags = 0xFFFFFFFF;
 	memset(&m, '\0', sizeof(metadata_t));
@@ -752,8 +753,8 @@
 	return ret;
 }
 
-sqlite_int64
-GetVideoMetadata(const char * path, char * name)
+int64_t
+GetVideoMetadata(const char *path, char *name)
 {
 	struct stat file;
 	int ret, i;
@@ -763,7 +764,7 @@
 	int audio_stream = -1, video_stream = -1;
 	enum audio_profiles audio_profile = PROFILE_AUDIO_UNKNOWN;
 	char fourcc[4];
-	sqlite_int64 album_art = 0;
+	int64_t album_art = 0;
 	char nfo[MAXPATHLEN], *ext;
 	struct song_metadata video;
 	metadata_t m;