Bug 1059601 - Make sure we don't try to play audio with a system driver. r=jesup
authorPaul Adenot <paul@paul.cx>
Wed, 27 Aug 2014 19:13:15 +0200
changeset 202240 546a04de2db6f9a5f29afbc4d72d617feb365936
parent 202239 7402fa69f77a84dcb29a830db8236a23e69e6a20
child 202241 602966888eb0643b0580b14205ac75c6474fd422
push idunknown
push userunknown
push dateunknown
reviewersjesup
bugs1059601
milestone34.0a1
Bug 1059601 - Make sure we don't try to play audio with a system driver. r=jesup
content/media/MediaStreamGraph.cpp
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -1305,22 +1305,24 @@ MediaStreamGraphImpl::Process(GraphTime 
                            "Stream did not produce enough data");
         }
       }
     }
     NotifyHasCurrentData(stream);
     // Only playback audio and video in real-time mode
     if (mRealtime) {
       CreateOrDestroyAudioStreams(aFrom, stream);
-      TrackTicks ticksPlayedForThisStream = PlayAudio(stream, aFrom, aTo);
-      if (!ticksPlayed) {
-        ticksPlayed = ticksPlayedForThisStream;
-      } else {
-        MOZ_ASSERT(!ticksPlayedForThisStream || ticksPlayedForThisStream == ticksPlayed,
-            "Each stream should have the same number of frame.");
+      if (CurrentDriver()->AsAudioCallbackDriver()) {
+        TrackTicks ticksPlayedForThisStream = PlayAudio(stream, aFrom, aTo);
+        if (!ticksPlayed) {
+          ticksPlayed = ticksPlayedForThisStream;
+        } else {
+          MOZ_ASSERT(!ticksPlayedForThisStream || ticksPlayedForThisStream == ticksPlayed,
+              "Each stream should have the same number of frame.");
+        }
       }
       PlayVideo(stream);
     }
     SourceMediaStream* is = stream->AsSourceStream();
     if (is) {
       UpdateBufferSufficiencyState(is);
     }
     GraphTime end;