Bug 857790 - Convert AudioParam time values to ticks relative to the source stream, not the destination stream; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 03 Apr 2013 17:28:49 -0400
changeset 127565 8084f411a027748411643040c44b21a156ed810f
parent 127564 75877a8b12b416646bdef40b126341e1c0bfa7a2
child 127566 66ff22df8956d7416a5764831903b6375d11c696
push id1655
push userbhackett@mozilla.com
push dateThu, 11 Apr 2013 23:17:41 +0000
reviewersroc
bugs857790
milestone23.0a1
Bug 857790 - Convert AudioParam time values to ticks relative to the source stream, not the destination stream; r=roc
content/media/webaudio/WebAudioUtils.cpp
mfbt/PodOperations.h
--- a/content/media/webaudio/WebAudioUtils.cpp
+++ b/content/media/webaudio/WebAudioUtils.cpp
@@ -16,21 +16,21 @@ struct ConvertTimeToTickHelper
   AudioNodeStream* mSourceStream;
   AudioNodeStream* mDestinationStream;
 
   static int64_t Convert(double aTime, void* aClosure)
   {
     TrackRate sampleRate = IdealAudioRate();
 
     ConvertTimeToTickHelper* This = static_cast<ConvertTimeToTickHelper*> (aClosure);
-    TrackTicks tick = This->mSourceStream->GetCurrentPosition();
-    StreamTime streamTime = TicksToTimeRoundDown(sampleRate, tick);
-    GraphTime graphTime = This->mSourceStream->StreamTimeToGraphTime(streamTime);
-    StreamTime destinationStreamTime = This->mDestinationStream->GraphTimeToStreamTime(graphTime);
-    return TimeToTicksRoundDown(sampleRate, destinationStreamTime + SecondsToMediaTime(aTime));
+    TrackTicks tick = This->mDestinationStream->GetCurrentPosition();
+    StreamTime destinationStreamTime = TicksToTimeRoundDown(sampleRate, tick);
+    GraphTime graphTime = This->mDestinationStream->StreamTimeToGraphTime(destinationStreamTime);
+    StreamTime streamTime = This->mSourceStream->GraphTimeToStreamTime(graphTime);
+    return TimeToTicksRoundDown(sampleRate, streamTime + SecondsToMediaTime(aTime));
   }
 };
 
 void
 WebAudioUtils::ConvertAudioParamToTicks(AudioParamTimeline& aParam,
                                         AudioNodeStream* aSource,
                                         AudioNodeStream* aDest)
 {
--- a/mfbt/PodOperations.h
+++ b/mfbt/PodOperations.h
@@ -9,18 +9,20 @@
  * These operations are preferable to memset, memcmp, and the like because they
  * don't require remembering to multiply by sizeof(T), array lengths, and so on
  * everywhere.
  */
 
 #ifndef mozilla_PodOperations_h
 #define mozilla_PodOperations_h
 
-#include "mozilla/Attributes.h"
-#include "mozilla/Util.h"
+#define MOZ_DELETE delete
+#define MOZ_ASSERT
+#define MOZ_ASSERT_IF
+#define MOZ_ALWAYS_INLINE __attribute__((always_inline)) __inline__
 
 #include <string.h>
 
 namespace mozilla {
 
 /** Set the contents of |t| to 0. */
 template<typename T>
 static void