mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-29 21:25:35 +00:00
Bug 904617: Part 2 - Expose Audio Stream Latency r=padenot,jesup
This commit is contained in:
parent
d480d1b82e
commit
c8b87de3c6
@ -322,6 +322,7 @@ class BufferedAudioStream : public AudioStream
|
||||
int64_t GetPosition();
|
||||
int64_t GetPositionInFrames();
|
||||
int64_t GetPositionInFramesInternal();
|
||||
int64_t GetLatencyInFrames();
|
||||
bool IsPaused();
|
||||
// This method acquires the monitor and forward the call to the base
|
||||
// class, to prevent a race on |mTimeStretcher|, in
|
||||
@ -775,6 +776,17 @@ BufferedAudioStream::GetPositionInFramesUnlocked()
|
||||
return std::min<uint64_t>(adjustedPosition, INT64_MAX);
|
||||
}
|
||||
|
||||
int64_t
|
||||
BufferedAudioStream::GetLatencyInFrames()
|
||||
{
|
||||
uint32_t latency;
|
||||
if(cubeb_stream_get_latency(mCubebStream, &latency)) {
|
||||
NS_WARNING("Could not get cubeb latency.");
|
||||
return 0;
|
||||
}
|
||||
return static_cast<int64_t>(latency);
|
||||
}
|
||||
|
||||
bool
|
||||
BufferedAudioStream::IsPaused()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user