Bug 1221587: patch 10 - Improve logging of callback driver/switching r=padenot
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -90,16 +90,22 @@ void GraphDriver::SwitchAtNextIteration(
PreviousDriver() &&
PreviousDriver()->AsAudioCallbackDriver()->IsSwitchingDevice() &&
PreviousDriver() != aNextDriver) {
return;
}
LIFECYCLE_LOG("Switching to new driver: %p (%s)",
aNextDriver, aNextDriver->AsAudioCallbackDriver() ?
"AudioCallbackDriver" : "SystemClockDriver");
+ if (mNextDriver &&
+ mNextDriver != GraphImpl()->CurrentDriver()) {
+ LIFECYCLE_LOG("Discarding previous next driver: %p (%s)",
+ mNextDriver.get(), mNextDriver->AsAudioCallbackDriver() ?
+ "AudioCallbackDriver" : "SystemClockDriver");
+ }
SetNextDriver(aNextDriver);
}
GraphTime
GraphDriver::StateComputedTime() const
{
return mGraphImpl->mStateComputedTime;
}
@@ -476,23 +482,23 @@ AsyncCubebTask::Run()
// assumes the caller does.
return NS_OK;
}
MOZ_ASSERT(mDriver);
switch(mOperation) {
case AsyncCubebOperation::INIT: {
- LIFECYCLE_LOG("AsyncCubebOperation::INIT\n");
+ LIFECYCLE_LOG("AsyncCubebOperation::INIT driver=%p\n", mDriver.get());
mDriver->Init();
mDriver->CompleteAudioContextOperations(mOperation);
break;
}
case AsyncCubebOperation::SHUTDOWN: {
- LIFECYCLE_LOG("AsyncCubebOperation::SHUTDOWN\n");
+ LIFECYCLE_LOG("AsyncCubebOperation::SHUTDOWN driver=%p\n", mDriver.get());
mDriver->Stop();
mDriver->CompleteAudioContextOperations(mOperation);
mDriver = nullptr;
mShutdownGrip = nullptr;
break;
}
@@ -861,21 +867,21 @@ AudioCallbackDriver::DataCallback(AudioD
// We want the interval [mIterationStart; mIterationEnd] to be before the
// interval [stateComputedTime; nextStateComputedTime]. We also want
// the distance between these intervals to be roughly equivalent each time, to
// ensure there is no clock drift between current time and state time. Since
// we can't act on the state time because we have to fill the audio buffer, we
// reclock the current time against the state time, here.
mIterationEnd = mIterationStart + 0.8 * inGraph;
- STREAM_LOG(LogLevel::Debug, ("interval[%ld; %ld] state[%ld; %ld] (frames: %ld) (durationMS: %u) (duration ticks: %ld)\n",
- (long)mIterationStart, (long)mIterationEnd,
- (long)stateComputedTime, (long)nextStateComputedTime,
- (long)aFrames, (uint32_t)durationMS,
- (long)(nextStateComputedTime - stateComputedTime)));
+ STREAM_LOG(LogLevel::Verbose, ("interval[%ld; %ld] state[%ld; %ld] (frames: %ld) (durationMS: %u) (duration ticks: %ld)\n",
+ (long)mIterationStart, (long)mIterationEnd,
+ (long)stateComputedTime, (long)nextStateComputedTime,
+ (long)aFrames, (uint32_t)durationMS,
+ (long)(nextStateComputedTime - stateComputedTime)));
mCurrentTimeStamp = TimeStamp::Now();
if (stateComputedTime < mIterationEnd) {
STREAM_LOG(LogLevel::Warning, ("Media graph global underrun detected"));
mIterationEnd = stateComputedTime;
}