Bug 857790 - Convert AudioParam time values to ticks relative to the source stream, not the destination stream; r=roc

This commit is contained in:
Ehsan Akhgari 2013-04-03 17:28:49 -04:00
parent e9235ac9fe
commit d7c5934da8
2 changed files with 9 additions and 7 deletions

View File

@ -21,11 +21,11 @@ struct ConvertTimeToTickHelper
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));
}
};

View File

@ -14,8 +14,10 @@
#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>