Bug 1370598 - Don't cap latency at 512 frames on Macs that are not Macbooks or Macbook Air. r?achronop draft
authorPaul Adenot <paul@paul.cx>
Tue, 16 Jan 2018 16:44:34 +0100
changeset 720959 b1d517d8cb16aeff3f9f537ebe12c31b2a4c4709
parent 720950 2951624227ccd8ccdaf1eca58b2d9adb0ecacc9c
child 746209 37dbdb8f4553e80107a13cb0e19bb91a9343a9b3
push id95705
push userpaul@paul.cx
push dateTue, 16 Jan 2018 16:23:33 +0000
reviewersachronop
bugs1370598
milestone59.0a1
Bug 1370598 - Don't cap latency at 512 frames on Macs that are not Macbooks or Macbook Air. r?achronop MozReview-Commit-ID: LEquEPECH9P
dom/media/GraphDriver.cpp
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -569,17 +569,17 @@ bool IsMacbookOrMacbookAir()
     // 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.get(), &len, NULL, 0);
     char* substring = strstr(model.get(), "MacBook");
     if (substring) {
       const size_t offset = strlen("MacBook");
-      if (strncmp(model.get() + offset, "Air", len - offset) ||
+      if (!strncmp(model.get() + offset, "Air", 3) ||
           isdigit(model[offset + 1])) {
         return true;
       }
     }
     return false;
   }
 #endif
   return false;