Bug 819849 - One condition of judging playing state for AudioChannelAgent should be larger or equal to CURRENT not HAVE_FUTURE_DATA. r=roc, a=blocking-basecamp
authorMarco Chen <mchen@mozilla.com>
Fri, 14 Dec 2012 13:02:54 +0800
changeset 117825 16d8a3a6cddba99932016a15036259b148464462
parent 117824 1eaf5b0d8c633ed65109fdefa457eb95c5869fb5
child 117826 56a099c5eb4a89b502dc1ea733f2240a2fb9eca9
push id84
push userryanvm@gmail.com
push dateMon, 24 Dec 2012 17:20:34 +0000
reviewersroc, blocking-basecamp
bugs819849
milestone18.0
Bug 819849 - One condition of judging playing state for AudioChannelAgent should be larger or equal to CURRENT not HAVE_FUTURE_DATA. r=roc, a=blocking-basecamp
content/html/content/src/nsHTMLMediaElement.cpp
--- a/content/html/content/src/nsHTMLMediaElement.cpp
+++ b/content/html/content/src/nsHTMLMediaElement.cpp
@@ -3809,18 +3809,19 @@ nsresult nsHTMLMediaElement::UpdateChann
   return NS_OK;
 }
 
 void nsHTMLMediaElement::UpdateAudioChannelPlayingState()
 {
   // The nsHTMLMediaElement is registered to the AudioChannelService only on B2G.
 #ifdef MOZ_B2G
   bool playingThroughTheAudioChannel =
-     (mReadyState >= nsIDOMHTMLMediaElement::HAVE_FUTURE_DATA &&
-      IsPotentiallyPlaying());
+     (mReadyState >= nsIDOMHTMLMediaElement::HAVE_CURRENT_DATA &&
+      !mPaused &&
+      !IsPlaybackEnded());
   if (playingThroughTheAudioChannel != mPlayingThroughTheAudioChannel) {
     mPlayingThroughTheAudioChannel = playingThroughTheAudioChannel;
 
     if (!mAudioChannelAgent) {
       nsresult rv;
       mAudioChannelAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1", &rv);
       if (!mAudioChannelAgent) {
         return;