mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 857790 - Convert AudioParam time values to ticks relative to the source stream, not the destination stream; r=roc
This commit is contained in:
parent
e9235ac9fe
commit
d7c5934da8
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user