Bug 1276851 - Remove AudioStream::mIsFirst. r=kinetik.

MozReview-Commit-ID: H9KCM2zZulA

--HG--
extra : rebase_source : 51387a1bd37f1b22bdb5100abe83af17c0caa481
This commit is contained in:
JW Wang 2016-05-31 14:18:58 +08:00
Родитель 8d11127d3c
Коммит 17e4b1d7d8
2 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -327,7 +327,7 @@ AudioStream::Init(uint32_t aNumChannels, uint32_t aRate,
const dom::AudioChannel aAudioChannel)
{
auto startTime = TimeStamp::Now();
mIsFirst = CubebUtils::GetFirstStream();
auto isFirst = CubebUtils::GetFirstStream();
LOG("%s channels: %d, rate: %d", __FUNCTION__, aNumChannels, aRate);
mInRate = mOutRate = aRate;
@ -354,11 +354,12 @@ AudioStream::Init(uint32_t aNumChannels, uint32_t aRate,
params.format = ToCubebFormat<AUDIO_OUTPUT_FORMAT>::value;
mAudioClock.Init();
return OpenCubeb(params, startTime);
return OpenCubeb(params, startTime, isFirst);
}
nsresult
AudioStream::OpenCubeb(cubeb_stream_params &aParams, TimeStamp aStartTime)
AudioStream::OpenCubeb(cubeb_stream_params& aParams,
TimeStamp aStartTime, bool aIsFirst)
{
cubeb* cubebContext = CubebUtils::GetCubebContext();
if (!cubebContext) {
@ -378,9 +379,9 @@ AudioStream::OpenCubeb(cubeb_stream_params &aParams, TimeStamp aStartTime)
}
TimeDuration timeDelta = TimeStamp::Now() - aStartTime;
LOG("creation time %sfirst: %u ms", mIsFirst ? "" : "not ",
LOG("creation time %sfirst: %u ms", aIsFirst ? "" : "not ",
(uint32_t) timeDelta.ToMilliseconds());
Telemetry::Accumulate(mIsFirst ? Telemetry::AUDIOSTREAM_FIRST_OPEN_MS :
Telemetry::Accumulate(aIsFirst ? Telemetry::AUDIOSTREAM_FIRST_OPEN_MS :
Telemetry::AUDIOSTREAM_LATER_OPEN_MS, timeDelta.ToMilliseconds());
return NS_OK;

Просмотреть файл

@ -313,7 +313,8 @@ protected:
int64_t GetPositionInFramesUnlocked();
private:
nsresult OpenCubeb(cubeb_stream_params &aParams, TimeStamp aStartTime);
nsresult OpenCubeb(cubeb_stream_params& aParams,
TimeStamp aStartTime, bool aIsFirst);
static long DataCallback_S(cubeb_stream*, void* aThis,
const void* /* aInputBuffer */, void* aOutputBuffer,
@ -371,7 +372,6 @@ private:
};
StreamState mState;
bool mIsFirst;
DataSource& mDataSource;
};