From f41ad034e5255151b0ef7939f8eb915cf7f2545c Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Wed, 6 Jan 2016 16:20:20 +0800 Subject: [PATCH] Bug 1221587: Improve logging of callback driver/switching r=padenot --HG-- extra : commitid : 72dxUhmH4Wm --- dom/media/GraphDriver.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index 80348df19129..24747652fc66 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -95,6 +95,12 @@ void GraphDriver::SwitchAtNextIteration(GraphDriver* aNextDriver) 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); } @@ -481,13 +487,13 @@ AsyncCubebTask::Run() 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); @@ -866,11 +872,11 @@ AudioCallbackDriver::DataCallback(AudioDataValue* aInputBuffer, // 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();