Bug 1079174 - allow video playback when AudioStream init fails. r=kinetik
authorJW Wang <jwwang@mozilla.com>
Tue, 07 Oct 2014 15:55:00 +0200
changeset 232495 1d9f0405f64d133bfd196112905cc51f62ffe177
parent 232494 55b7368ee7f86ad27df12138c14b8a8468accc4e
child 232496 d25bc2a722d9b54829a57b4a0cdbb27e9ac83115
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik
bugs1079174
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1079174 - allow video playback when AudioStream init fails. r=kinetik
content/media/MediaDecoderStateMachine.cpp
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -3138,17 +3138,23 @@ void MediaDecoderStateMachine::OnAudioSi
   AssertCurrentThreadInMonitor();
   // AudioSink not used with captured streams, so ignore errors in this case.
   if (mAudioCaptured) {
     return;
   }
 
   mAudioCompleted = true;
 
-  // Notify media decoder/element about this error.
+  // Make the best effort to continue playback when there is video.
+  if (HasVideo()) {
+    return;
+  }
+
+  // Otherwise notify media decoder/element about this error for it makes
+  // no sense to play an audio-only file without sound output.
   RefPtr<nsIRunnable> task(
     NS_NewRunnableMethod(this, &MediaDecoderStateMachine::OnDecodeError));
   nsresult rv = mDecodeTaskQueue->Dispatch(task);
   if (NS_FAILED(rv)) {
     DECODER_WARN("Failed to dispatch OnDecodeError");
   }
 }