From 36914534af2ccaeca265ad2ee334ada4f94d7422 Mon Sep 17 00:00:00 2001 From: Alastor Wu Date: Mon, 9 Mar 2015 15:41:51 +0800 Subject: [PATCH] Bug 1119936 - Audio from FM Radio or Music app ceases to play when switching between front/back camera. r=roc --- dom/html/HTMLMediaElement.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index 2fc0b30815eb..26bb11c90d80 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -693,9 +693,11 @@ void HTMLMediaElement::AbortExistingLoads() if (mNetworkState != nsIDOMHTMLMediaElement::NETWORK_EMPTY) { NS_ASSERTION(!mDecoder && !mSrcStream, "How did someone setup a new stream/decoder already?"); + // ChangeNetworkState() will call UpdateAudioChannelPlayingState() + // indirectly which depends on mPaused. So we need to update mPaused first. + mPaused = true; ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_EMPTY); ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_NOTHING); - mPaused = true; if (fireTimeUpdate) { // Since we destroyed the decoder above, the current playback position