Index: AMFData.h
--- AMFData.h.orig	2009-01-22 02:09:49 +0100
+++ AMFData.h	2009-06-19 19:40:41 +0200
@@ -17,13 +17,20 @@
 #ifdef __APPLE__
   #include <architecture/byte_order.h>
   #define hton64(x) OSSwapHostToBigInt64(x)
-#else
+#elif defined(__linux__)
   #include <byteswap.h>
   #if __BYTE_ORDER == __LITTLE_ENDIAN
     #define hton64(x) bswap_64(x)
   #else
     #define hton64(x) (x)
   #endif
+#elif defined(__FreeBSD__)
+  #include <sys/endian.h>
+  #if __BYTE_ORDER == __LITTLE_ENDIAN
+    #define hton64(x) bswap64(x)
+  #else
+    #define hton64(x) (x)
+  #endif
 #endif
 
 enum AMFType {
Index: SConscript
--- SConscript.orig	2007-06-05 05:35:40 +0200
+++ SConscript	2009-06-19 19:40:41 +0200
@@ -4,6 +4,6 @@
                         source = ['flvtool++.cpp',
                                   'AMFData.cpp'],
                         CPPPATH= ['.',
-                                  '/usr/local/include/boost-1_33_1'])
+                                  '@l_prefix@/include', '@l_prefix@/include/boost'])
 
 Return('flvtoolxx')
Index: SConstruct
--- SConstruct.orig	2009-06-19 05:23:23 +0200
+++ SConstruct	2009-06-19 19:40:41 +0200
@@ -1,5 +1,5 @@
 libd = '#lib/'
-env = Environment(CPPFLAGS='-ggdb -O3 -Wall', LINKFLAGS='-ggdb')
+env = Environment(CPPFLAGS='-O3', LINKFLAGS='')
 env.TargetSignatures('content')
 
 Export('env libd')
Index: flvtool++.cpp
--- flvtool++.cpp.orig	2009-06-19 05:29:27 +0200
+++ flvtool++.cpp	2009-06-19 19:40:41 +0200
@@ -214,6 +214,7 @@
             case 2: codec = "H.263"; break;
             case 3: codec = "SCREEN"; break;
             case 4: codec = "VP6"; break;
+            case 5: codec = "VP6A"; break;
             case 6: codec = "SCREEN v2"; break;
             case 7: codec = "H.264"; break;
             default: codec = "(unknown)";
@@ -394,7 +395,7 @@
           onMetaData->dmap["stereo"] = shared_ptr<AMFData>(new AMFBoolean(stereo));
           const char* audio_format_str = NULL;
           switch (audio_format) {
-            case 0: audio_format_str = "Uncompressed"; break;
+            case 0: audio_format_str = "Uncompressed (PCM)"; break;
             case 1: audio_format_str = "ADPCM"; break;
             case 2: audio_format_str = "MP3"; break;
             case 3: audio_format_str = "Linear PCM (little endian)"; break;
Index: serialized_buffer.h
--- serialized_buffer.h.orig	2009-06-12 08:58:56 +0200
+++ serialized_buffer.h	2009-06-19 19:40:41 +0200
@@ -18,7 +18,7 @@
 #define LE32(x) OSSwapLittleToHostInt32(x)
 #define LE64(x) OSSwapLittleToHostInt64(x)
 
-#else // Linux byteswap defs
+#elif defined(__linux__)
 
 #include <byteswap.h>
 #include <endian.h>
@@ -39,6 +39,26 @@
   #define LE64(x) __bswap_64(x)
 #endif
 
+#elif defined(__FreeBSD__)
+
+#include <sys/endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+  #define BE16(x) bswap16(x)
+  #define BE32(x) bswap32(x)
+  #define BE64(x) bswap64(x)
+  #define LE16(x) (x)
+  #define LE32(x) (x)
+  #define LE64(x) (x)
+#else
+  #define BE16(x) (x)
+  #define BE32(x) (x)
+  #define BE64(x) (x)
+  #define LE16(x) bswap16(x)
+  #define LE32(x) bswap32(x)
+  #define LE64(x) bswap64(x)
+#endif
+
 #endif
 
 class end_of_buffer : public std::exception {
