Bug 1432869 - Update usage of cubeb_stream_params to set newly exposed prefs member. r?achronop draft
authorBryce Van Dyk <bvandyk@mozilla.com>
Mon, 22 Jan 2018 13:20:29 -0500
changeset 748799 fcf42e5c2fb145ff1e60b97307d9377849779684
parent 748412 e5ee0bacff143a939da0e4c15243ed102a59af36
child 748800 feb08bc351a1daa43088a84773d05e897ebf46d9
push id97241
push userbvandyk@mozilla.com
push dateTue, 30 Jan 2018 13:55:39 +0000
reviewersachronop
bugs1432869
milestone60.0a1
Bug 1432869 - Update usage of cubeb_stream_params to set newly exposed prefs member. r?achronop The changes to the cubeb API mean that the new prefs member on cubeb_stream_params should be explicitly set. This changeset does so. MozReview-Commit-ID: 1hwjLTriaBP
dom/media/AudioStream.cpp
dom/media/GraphDriver.cpp
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -345,16 +345,17 @@ AudioStream::Init(uint32_t aNumChannels,
 
   mDumpFile = OpenDumpFile(aNumChannels, aRate);
 
   cubeb_stream_params params;
   params.rate = aRate;
   params.channels = mOutChannels;
   params.layout = CubebUtils::ConvertChannelMapToCubebLayout(aChannelMap);
   params.format = ToCubebFormat<AUDIO_OUTPUT_FORMAT>::value;
+  params.prefs = CUBEB_STREAM_PREF_NONE;
 
   mAudioClock.Init(aRate);
 
   cubeb* cubebContext = CubebUtils::GetCubebContext();
   if (!cubebContext) {
     LOGE("Can't get cubeb context!");
     CubebUtils::ReportCubebStreamInitFailure(true);
     return NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR;
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -622,16 +622,17 @@ AudioCallbackDriver::Init()
     return true;
   }
 
   mBuffer = AudioCallbackBufferWrapper<AudioDataValue>(mOutputChannels);
   mScratchBuffer = SpillBuffer<AudioDataValue, WEBAUDIO_BLOCK_SIZE * 2>(mOutputChannels);
 
   output.channels = mOutputChannels;
   output.layout = CubebUtils::GetPreferredChannelLayoutOrSMPTE(cubebContext, mOutputChannels);
+  output.prefs = CUBEB_STREAM_PREF_NONE;
 
   Maybe<uint32_t> latencyPref = CubebUtils::GetCubebMSGLatencyInFrames();
   if (latencyPref) {
     latency_frames = latencyPref.value();
   } else {
     if (cubeb_get_min_latency(cubebContext, &output, &latency_frames) != CUBEB_OK) {
       NS_WARNING("Could not get minimal latency from cubeb.");
     }