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 127583 8084f411a027748411643040c44b21a156ed810f
parent 127582 75877a8b12b416646bdef40b126341e1c0bfa7a2
child 127584 66ff22df8956d7416a5764831903b6375d11c696
push id24509
push userryanvm@gmail.com
push dateFri, 05 Apr 2013 00:57:47 +0000
treeherdermozilla-central@55f9e3e3dae7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs857790
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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