Bug 1277284 - Reset the volume when starting a new audio stream for a MediaStreamGraph. r=jesup
authorPaul Adenot <paul@paul.cx>
Thu, 02 Jun 2016 15:46:17 +0200
changeset 300374 c1723461dd067a0be857cb980b1101f80bb91132
parent 300373 d6070dd805cf06ff2be62b95b34adce09ace2061
child 300375 139ce9bc8149993a4c3bc92c5246ed7f1bb6c8a3
push id77912
push userpaul@paul.cx
push dateFri, 03 Jun 2016 13:19:27 +0000
treeherdermozilla-inbound@c1723461dd06 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1277284
milestone49.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 1277284 - Reset the volume when starting a new audio stream for a MediaStreamGraph. r=jesup This prevents having the volume set to zero in some cases. MozReview-Commit-ID: 4JSCDcd7jmT
dom/media/GraphDriver.cpp
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -621,16 +621,19 @@ AudioCallbackDriver::Init()
         cubeb_stream_init(CubebUtils::GetCubebContext(), &stream,
                           "AudioCallbackDriver",
                           input_id,
                           mGraphImpl->mInputWanted ? &input : nullptr,
                           output_id,
                           mGraphImpl->mOutputWanted ? &output : nullptr, latency,
                           DataCallback_s, StateCallback_s, this) == CUBEB_OK) {
       mAudioStream.own(stream);
+      int rv = cubeb_stream_set_volume(mAudioStream, CubebUtils::GetVolumeScale());
+      NS_WARN_IF_FALSE(rv == CUBEB_OK,
+          "Could not set the audio stream volume in GraphDriver.cpp");
     } else {
 #ifdef MOZ_WEBRTC
       StaticMutexAutoUnlock unlock(AudioInputCubeb::Mutex());
 #endif
       NS_WARNING("Could not create a cubeb stream for MediaStreamGraph, falling back to a SystemClockDriver");
       // Fall back to a driver using a normal thread.
       MonitorAutoLock lock(GraphImpl()->GetMonitor());
       SetNextDriver(new SystemClockDriver(GraphImpl()));