From 4b5ebae4386001c43b542756c9a2eca8dbe58b31 Mon Sep 17 00:00:00 2001 From: alwu Date: Thu, 30 May 2019 07:39:40 +0000 Subject: [PATCH] Bug 1555197 - part3 : modify log. r=jya Add and modify some log content in order to help debugging. Differential Revision: https://phabricator.services.mozilla.com/D32936 --HG-- extra : moz-landing-system : lando --- dom/media/TextTrack.cpp | 4 +++- dom/media/webvtt/vtt.jsm | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dom/media/TextTrack.cpp b/dom/media/TextTrack.cpp index f082e299c969..d8a1cb92ebf1 100644 --- a/dom/media/TextTrack.cpp +++ b/dom/media/TextTrack.cpp @@ -168,7 +168,7 @@ void TextTrack::GetId(nsAString& aId) const { } void TextTrack::AddCue(TextTrackCue& aCue) { - WEBVTT_LOG("AddCue %p", &aCue); + WEBVTT_LOG("AddCue %p [%f:%f]", &aCue, aCue.StartTime(), aCue.EndTime()); TextTrack* oldTextTrack = aCue.GetTrack(); if (oldTextTrack) { ErrorResult dummy; @@ -349,6 +349,8 @@ void TextTrack::GetCurrentCuesAndOtherCues( const double playbackTime = mediaElement->CurrentTime(); for (uint32_t idx = 0; idx < mCueList->Length(); idx++) { TextTrackCue* cue = (*mCueList)[idx]; + WEBVTT_LOG("cue %p [%f:%f], playbackTime=%f", cue, cue->StartTime(), + cue->EndTime(), playbackTime); if (cue->StartTime() <= playbackTime && cue->EndTime() > playbackTime) { WEBVTT_LOG("Add cue %p [%f:%f] to current cue list", cue, cue->StartTime(), cue->EndTime()); diff --git a/dom/media/webvtt/vtt.jsm b/dom/media/webvtt/vtt.jsm index 498267849cde..882cb286a1f1 100644 --- a/dom/media/webvtt/vtt.jsm +++ b/dom/media/webvtt/vtt.jsm @@ -1113,8 +1113,9 @@ XPCOMUtils.defineLazyPreferenceGetter(this, "supportPseudo", // @param controls : A Control bar element. Cues' position will be // affected and repositioned according to it. WebVTT.processCues = function(window, cues, overlay, controls) { + LOG(`=== processCues ===`); if (!cues) { - LOG(`Abort processing because no cue.`); + LOG(`clear display and abort processing because of no cue.`); clearAllCuesDiv(overlay); lastDisplayedCueNums = 0; return;