=== modified file 'mixxx/src/SConscript'
--- mixxx/src/SConscript	2009-12-10 08:36:41 +0000
+++ mixxx/src/SConscript	2009-12-25 04:22:24 +0000
@@ -644,13 +644,25 @@
 
 	#QT4
 	env.Append(LINKFLAGS = '-framework QtCore -framework QtOpenGL -framework Qt3Support -framework QtGui -framework QtXml -framework QtNetwork -framework QtSql -framework QtScript')
-	env.Append(CPPPATH = ['/Library/Frameworks/QtCore.framework/Headers/',
-				'/Library/Frameworks/QtOpenGL.framework/Headers/',
-				'/Library/Frameworks/Qt3Support.framework/Headers/',
-				'/Library/Frameworks/QtGui.framework/Headers/',
-				'/Library/Frameworks/QtXml.framework/Headers/',
-				'/Library/Frameworks/QtXml.framework/Headers/',
-				'/Library/Frameworks/QtScript.framework/Headers/'])
+	frameworkPrefix = "";
+	if env['QTDIR'].find("/opt/local/libexec/qt4-mac") == 0:
+		# MacPorts
+		print "Mac Ports detected, using Mac Ports frameworks, libs and includes..."
+		mpPrefix = "/opt/local"
+		env.Append(LIBPATH = [mpPrefix+'/lib'])
+		env.Append(CPPPATH = [mpPrefix+'/include'])
+		env.Prepend(LINKFLAGS = ['-F'+mpPrefix+'/Library/Frameworks/'])
+		frameworkPrefix = mpPrefix
+		env.Append(CPPDEFINES = '__MP4V2__') # TODO: move this define to the M4A section, activate if mp4v2/mp4v2.h exists...  here it is harmless because if you have macports you can only have mp4v2 1.9 or greater
+		frameworkPrefix = "/opt/local"
+
+	env.Append(CPPPATH = [frameworkPrefix + '/Library/Frameworks/QtCore.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtOpenGL.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/Qt3Support.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtGui.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtXml.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtXml.framework/Headers/',
+				frameworkPrefix + '/Library/Frameworks/QtScript.framework/Headers/'])
 
 	#Non-standard libpaths for fink and darwin ports
 	env.Append(LIBPATH = ['/sw/lib'])

=== modified file 'mixxx/src/m4a/mp4-mixxx.cpp'
--- mixxx/src/m4a/mp4-mixxx.cpp	2009-10-19 22:02:18 +0000
+++ mixxx/src/m4a/mp4-mixxx.cpp	2009-12-25 03:50:43 +0000
@@ -35,7 +35,11 @@
 // #include "debug.h"
 // #include "file.h"
 
+#ifdef __MP4V2__
+#include <mp4v2/mp4v2.h>
+#else
 #include <mp4.h>
+#endif
 #include <faad.h>
 
 #include <errno.h>
@@ -182,9 +186,14 @@
         if (faacDecInit2(priv->decoder, buf, buf_size,
                          (long unsigned int*) &priv->sample_rate, &priv->channels) < 0) {
 #else
+#if MP4V2_PROJECT_version_hex >= 0x00010900
+        if (faacDecInit2(priv->decoder, buf, buf_size,
+                         (long unsigned int*) &priv->sample_rate, &priv->channels) < 0) {
+#else
         if (faacDecInit2(priv->decoder, buf, buf_size,
                          (uint32_t*) &priv->sample_rate, &priv->channels) < 0) {
 #endif
+#endif
     free(buf);
 		goto out;
 	}

=== modified file 'mixxx/src/soundsourcem4a.cpp'
--- mixxx/src/soundsourcem4a.cpp	2009-09-22 20:13:30 +0000
+++ mixxx/src/soundsourcem4a.cpp	2009-12-25 03:47:13 +0000
@@ -182,7 +182,11 @@
         value = NULL;
     }
 
+#if MP4V2_PROJECT_version_hex >= 0x00010900
+    uint16_t bpm = 0;
+#else
     u_int16_t bpm = 0;
+#endif
     if (MP4GetMetadataTempo(mp4file, &bpm)) {
         if(bpm > 0) {
             Track->setBpm(bpm);

=== modified file 'mixxx/src/soundsourcem4a.h'
--- mixxx/src/soundsourcem4a.h	2009-09-22 20:13:30 +0000
+++ mixxx/src/soundsourcem4a.h	2009-12-25 04:23:10 +0000
@@ -17,7 +17,11 @@
 #ifndef SOUNDSOURCEM4A_H
 #define SOUNDSOURCEM4A_H
 
+#ifdef __MP4V2__
+#include <mp4v2/mp4v2.h>
+#else
 #include <mp4.h>
+#endif
 #include <neaacdec.h>
 
 #include <QString>

