From 49558158fa7110607ace9083281671140c01301c Mon Sep 17 00:00:00 2001 From: Nico Grunbaum Date: Tue, 3 Oct 2023 19:13:23 +0000 Subject: [PATCH] Bug 1855369 - log underlying track when it exists;r=pehrsons Differential Revision: https://phabricator.services.mozilla.com/D189548 --- dom/media/DOMMediaStream.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dom/media/DOMMediaStream.cpp b/dom/media/DOMMediaStream.cpp index 9f5e1b7ef24a..caaf3d8fbb7c 100644 --- a/dom/media/DOMMediaStream.cpp +++ b/dom/media/DOMMediaStream.cpp @@ -334,8 +334,16 @@ void DOMMediaStream::AddTrack(MediaStreamTrack& aTrack) { } void DOMMediaStream::RemoveTrack(MediaStreamTrack& aTrack) { - LOG(LogLevel::Info, ("DOMMediaStream %p Removing track %p (from track %p)", - this, &aTrack, aTrack.GetTrack())); + if (static_cast(gMediaStreamLog)->ShouldLog(LogLevel::Info)) { + if (aTrack.Ended()) { + LOG(LogLevel::Info, + ("DOMMediaStream %p Removing (ended) track %p", this, &aTrack)); + } else { + LOG(LogLevel::Info, + ("DOMMediaStream %p Removing track %p (from track %p)", this, &aTrack, + aTrack.GetTrack())); + } + } if (!mTracks.RemoveElement(&aTrack)) { LOG(LogLevel::Debug,