Index: darwinfirewiredevice.cpp
===================================================================
--- darwinfirewiredevice.cpp	(revision 24085)
+++ darwinfirewiredevice.cpp	(working copy)
@@ -13,10 +13,6 @@
 #undef always_inline
 #include <IOKit/IOMessage.h>
 #include <IOKit/IOKitLib.h>
-#include <IOKit/firewire/IOFireWireLib.h>
-#include <IOKit/firewire/IOFireWireLibIsoch.h>
-#include <IOKit/firewire/IOFireWireFamilyCommon.h>
-#include <IOKit/avc/IOFireWireAVCLib.h>
 
 // Std C++ headers
 #include <algorithm>
@@ -29,30 +25,8 @@
 #include "mythverbose.h"
 
 // Apple Firewire example headers
-#include <AVCVideoServices/StringLogger.h>
-#include <AVCVideoServices/AVSShared.h>
-#include <AVCVideoServices/MPEG2Receiver.h>
+#include <AVCVideoServices/AVCVideoServices.h>
 
-// header not used because it also requires MPEG2Transmitter.h
-//#include <AVCVideoServices/FireWireMPEG.h>
-namespace AVS
-{
-    IOReturn CreateMPEG2Receiver(
-        MPEG2Receiver           **ppReceiver,
-        DataPushProc              dataPushProcHandler,
-        void                     *pDataPushProcRefCon = nil,
-        MPEG2ReceiverMessageProc  messageProcHandler  = nil,
-        void                     *pMessageProcRefCon  = nil,
-        StringLogger             *stringLogger        = nil,
-        IOFireWireLibNubRef       nubInterface        = nil,
-        unsigned int              cyclesPerSegment    =
-            kCyclesPerReceiveSegment,
-        unsigned int              numSegments         =
-            kNumReceiveSegments,
-        bool                      doIRMAllocations    = false);
-    IOReturn DestroyMPEG2Receiver(MPEG2Receiver *pReceiver);
-}
-
 #define LOC      QString("DFireDev(%1): ").arg(guid_to_string(m_guid))
 #define LOC_WARN QString("DFireDev(%1), Warning: ").arg(guid_to_string(m_guid))
 #define LOC_ERR  QString("DFireDev(%1), Error: ").arg(guid_to_string(m_guid))
@@ -375,7 +349,8 @@
         uint32_t val;
         int ret = (*fw_handle)->ReadQuadlet(
             fw_handle, dev, &addr, (UInt32*) &val, false, 0);
-
+        val = EndianU32_BtoN(val);
+      
         return (ret == kIOReturnSuccess) ? (int)((val>>30) & 0x3) : -1;
     }
 
@@ -400,6 +375,7 @@
     uint32_t val;
     int ret = (*fw_handle)->ReadQuadlet(
         fw_handle, dev, &addr, (UInt32*) &val, false, 0);
+    val = EndianU32_BtoN(val);
 
     if (ret != kIOReturnSuccess)
         return false;
@@ -706,7 +682,8 @@
     {
         return false;
     }
-
+    old_plug_val = EndianU32_BtoN(old_plug_val);
+  
     int old_plug_cnt = (old_plug_val >> 24) & 0x3f;
     int old_fw_chan  = (old_plug_val >> 16) & 0x3f;
     int old_speed    = (old_plug_val >> 14) & 0x03;
@@ -750,6 +727,8 @@
     new_plug_val &= ~(0x03<<14);
     new_plug_val |= (new_speed & 0x03) << 14;
 
+    old_plug_val = EndianU32_NtoB(old_plug_val);
+    new_plug_val = EndianU32_NtoB(new_plug_val);
     return (kIOReturnSuccess == (*fw_handle)->CompareSwap(
                 fw_handle, dev, &addr, old_plug_val, new_plug_val, false, 0));
 }
