Bug 1298777 - don't need to capture audio for media element without audio track. r=jwwang

MozReview-Commit-ID: DKRGiuTGjtg
This commit is contained in:
Alastor Wu
2016-09-02 18:47:10 +08:00
parent b66647d94a
commit 6d093d007f

View File

@@ -6550,7 +6550,16 @@ HTMLMediaElement::SetMediaInfo(const MediaInfo aInfo)
void
HTMLMediaElement::AudioCaptureStreamChangeIfNeeded()
{
// TODO : only capture media element with audio track, see bug1298777.
// Window audio capturing only happens after creating audio channel agent.
if (!mAudioChannelAgent) {
return;
}
// No need to capture a silence media element.
if (!HasAudio()) {
return;
}
if (mAudioCapturedByWindow && !mCaptureStreamPort) {
nsCOMPtr<nsPIDOMWindowInner> window = OwnerDoc()->GetInnerWindow();
if (!OwnerDoc()->GetInnerWindow()) {