Backed out changeset 19dca15f4185 (bug 1175396) for bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 16 Jul 2015 21:02:52 -0400
changeset 204934 2b69da6a768e
parent 204933 19dca15f4185
child 204935 34a6a0090649
push id856
push userryanvm@gmail.com
push dateFri, 17 Jul 2015 01:24:04 +0000
treeherdermozilla-b2g32_v2_0@34a6a0090649 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1175396
milestone32.0
backs out19dca15f4185
Backed out changeset 19dca15f4185 (bug 1175396) for bustage.
content/media/MediaDecoderStateMachine.cpp
content/media/MediaDecoderStateMachine.h
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -897,17 +897,17 @@ void MediaDecoderStateMachine::AudioLoop
       // we pushed to the audio hardware. We must push silence into the audio
       // hardware so that the next audio chunk begins playback at the correct
       // time.
       missingFrames = std::min<int64_t>(UINT32_MAX, missingFrames.value());
       VERBOSE_LOG("playing %d frames of silence", int32_t(missingFrames.value()));
       framesWritten = PlaySilence(static_cast<uint32_t>(missingFrames.value()),
                                   channels, playedFrames.value());
     } else {
-      framesWritten = PlayFromAudioQueue(sampleTime.value(), channels, rate);
+      framesWritten = PlayFromAudioQueue(sampleTime.value(), channels);
     }
     audioDuration += framesWritten;
     {
       ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
       CheckedInt64 playedUsecs = FramesToUsecs(audioDuration, rate) + audioStartTime;
       if (!playedUsecs.isValid()) {
         NS_WARNING("Int overflow calculating audio end time");
         break;
@@ -978,40 +978,34 @@ uint32_t MediaDecoderStateMachine::PlayS
   NS_ASSERTION(!mAudioStream->IsPaused(), "Don't play when paused");
   uint32_t maxFrames = SILENCE_BYTES_CHUNK / aChannels / sizeof(AudioDataValue);
   uint32_t frames = std::min(aFrames, maxFrames);
   WriteSilence(mAudioStream, frames);
   return frames;
 }
 
 uint32_t MediaDecoderStateMachine::PlayFromAudioQueue(uint64_t aFrameOffset,
-                                                      uint32_t aChannels,
-                                                      uint32_t aRate)
+                                                      uint32_t aChannels)
 {
   NS_ASSERTION(OnAudioThread(), "Only call on audio thread.");
   NS_ASSERTION(!mAudioStream->IsPaused(), "Don't play when paused");
   nsAutoPtr<AudioData> audio(AudioQueue().PopFront());
   {
     ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
     NS_WARN_IF_FALSE(IsPlaying(), "Should be playing");
     // Awaken the decode loop if it's waiting for space to free up in the
     // audio queue.
     mDecoder->GetReentrantMonitor().NotifyAll();
   }
   int64_t offset = -1;
   uint32_t frames = 0;
   VERBOSE_LOG("playing %d frames of data to stream for AudioData at %lld",
               audio->mFrames, audio->mTime);
-  if (audio->mRate == aRate && audio->mChannels == aChannels) {
-    mAudioStream->Write(audio->mAudioData, audio->mFrames);
-  } else {
-    VERBOSE_LOG("mismatched sample format mInfo=[%uHz/%u channels] audio=[%uHz/%u channels]",
-                 aRate, aChannels, audio->mRate, audio->mChannels);
-    PlaySilence(audio->mFrames, aChannels, 0);
-  }
+  mAudioStream->Write(audio->mAudioData,
+                      audio->mFrames);
 
   aChannels = mAudioStream->GetOutChannels();
 
   StartAudioStreamPlaybackIfNeeded(mAudioStream);
 
   offset = audio->mOffset;
   frames = audio->mFrames;
 
--- a/content/media/MediaDecoderStateMachine.h
+++ b/content/media/MediaDecoderStateMachine.h
@@ -499,17 +499,17 @@ protected:
   // impossibly large chunk of memory in order to play back silence. Called
   // on the audio thread.
   uint32_t PlaySilence(uint32_t aFrames,
                        uint32_t aChannels,
                        uint64_t aFrameOffset);
 
   // Pops an audio chunk from the front of the audio queue, and pushes its
   // audio data to the audio hardware.
-  uint32_t PlayFromAudioQueue(uint64_t aFrameOffset, uint32_t aChannels, uint32_t aRate);
+  uint32_t PlayFromAudioQueue(uint64_t aFrameOffset, uint32_t aChannels);
 
   // Stops the audio thread. The decoder monitor must be held with exactly
   // one lock count. Called on the state machine thread.
   void StopAudioThread();
 
   // Starts the audio thread. The decoder monitor must be held with exactly
   // one lock count. Called on the state machine thread.
   nsresult StartAudioThread();