Bug 1309761 - Some tweaks to MediaDecoder::DumpDebugInfo(). draft
authorJW Wang <jwwang@mozilla.com>
Tue, 11 Oct 2016 16:58:09 +0800
changeset 424591 5e60b2a6f69e1f7712a34bdef404372c0daa373b
parent 424590 3c9b47a2a0485461ff1fea9b597e7789fa7bb149
child 533712 2c9363df637d94d42f5463864c347f8c525915f7
push id32198
push userjwwang@mozilla.com
push dateThu, 13 Oct 2016 02:46:43 +0000
bugs1309761
milestone52.0a1
Bug 1309761 - Some tweaks to MediaDecoder::DumpDebugInfo(). MozReview-Commit-ID: 9e7sImUs2vz
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1890,24 +1890,26 @@ MediaDecoder::NextFrameBufferedStatus()
     : MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
 }
 
 void
 MediaDecoder::DumpDebugInfo()
 {
   MOZ_ASSERT(!IsShutdown());
   DUMP_LOG("metadata: channels=%u rate=%u hasAudio=%d hasVideo=%d, "
-           "state: mPlayState=%s mIsDormant=%d",
+           "state: mPlayState=%s mIsDormant=%d, mdsm=%p",
            mInfo ? mInfo->mAudio.mChannels : 0, mInfo ? mInfo->mAudio.mRate : 0,
            mInfo ? mInfo->HasAudio() : 0, mInfo ? mInfo->HasVideo() : 0,
-           PlayStateStr(), mIsDormant);
+           PlayStateStr(), mIsDormant, GetStateMachine());
 
   nsString str;
   GetMozDebugReaderData(str);
-  DUMP_LOG("reader data:\n%s", NS_ConvertUTF16toUTF8(str).get());
+  if (!str.IsEmpty()) {
+    DUMP_LOG("reader data:\n%s", NS_ConvertUTF16toUTF8(str).get());
+  }
 
   if (GetStateMachine()) {
     GetStateMachine()->DumpDebugInfo();
   }
 }
 
 void
 MediaDecoder::NotifyAudibleStateChanged()