Bug 1300818: bustage fix rs=kwierso on a CLOSED TREE
authorRandell Jesup <rjesup@jesup.org>
Fri, 14 Oct 2016 15:13:30 -0400
changeset 360973 f2d64ec287a1c2d55e4b03209ea5ee392395b91d
parent 360972 00fd40882351274473a8eacbdcf7f16b0ad7f8a6
child 360974 cb6b42803b04e80b7b1109813e535419d422e696
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskwierso
bugs1300818
milestone52.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 1300818: bustage fix rs=kwierso on a CLOSED TREE
dom/media/GraphDriver.cpp
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -586,35 +586,34 @@ AudioCallbackDriver::~AudioCallbackDrive
 }
 
 bool IsMacbookOrMacbookAir()
 {
 #ifdef XP_MACOSX
   size_t len = 0;
   sysctlbyname("hw.model", NULL, &len, NULL, 0);
   if (len) {
-    nsAutoPtr<char> model = new char[len];
+    UniquePtr<char[]> model(new char[len]);
     // This string can be
     // MacBook%d,%d for a normal MacBook
     // MacBookPro%d,%d for a MacBook Pro
     // MacBookAir%d,%d for a Macbook Air
-    sysctlbyname("hw.model", model, &len, NULL, 0);
-    char* substring = strstr(model, "MacBook");
+    sysctlbyname("hw.model", model.get(), &len, NULL, 0);
+    char* substring = strstr(model.get(), "MacBook");
     if (substring) {
       const size_t offset = strlen("MacBook");
-      if (strncmp(model + offset, "Air", len - offset) ||
+      if (strncmp(model.get() + offset, "Air", len - offset) ||
           isdigit(model[offset + 1])) {
         return true;
       }
     }
     return false;
   }
-#else
+#endif
   return false;
-#endif
 }
 
 void
 AudioCallbackDriver::Init()
 {
   cubeb* cubebContext = CubebUtils::GetCubebContext();
   if (!cubebContext) {
     NS_WARNING("Could not get cubeb context.");
@@ -663,17 +662,17 @@ AudioCallbackDriver::Init()
       NS_WARNING("Could not get minimal latency from cubeb.");
       return;
     }
   }
 
   // Macbook and MacBook air don't have enough CPU to run very low latency
   // MediaStreamGraphs, cap the minimal latency to 512 frames int this case.
   if (IsMacbookOrMacbookAir()) {
-    latency_frames = std::max(512, latency_frames);
+    latency_frames = std::max((uint32_t) 512, latency_frames);
   }
 
 
   input = output;
   input.channels = mInputChannels; // change to support optional stereo capture
 
   cubeb_stream* stream = nullptr;
   CubebUtils::AudioDeviceID input_id = nullptr, output_id = nullptr;