Bug 1451798 - Check the variable actually containing the string. r=jib, a=RyanVM
authorAndreas Pehrson <pehrsons@mozilla.com>
Fri, 06 Apr 2018 15:06:46 +0200
changeset 460675 18f05dfc1f61a82feaa96b5dd9d896d9ce475d5a
parent 460674 57318d4d7ca9f00ad4fa688516b43b4a39cadcf0
child 460676 ab7ad29703d5e7264a2f7f795bbe9b7be0f5e112
push id9012
push userryanvm@gmail.com
push dateTue, 10 Apr 2018 13:31:42 +0000
treeherdermozilla-beta@ac866c77cec0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, RyanVM
bugs1451798
milestone60.0
Bug 1451798 - Check the variable actually containing the string. r=jib, a=RyanVM MozReview-Commit-ID: 2xizfHwVPiW
dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -108,39 +108,39 @@ MediaEngineRemoteVideoSource::SetName(ns
 
   // Set facing mode based on device name.
 #if defined(ANDROID)
   // Names are generated. Example: "Camera 0, Facing back, Orientation 90"
   //
   // See media/webrtc/trunk/webrtc/modules/video_capture/android/java/src/org/
   // webrtc/videoengine/VideoCaptureDeviceInfoAndroid.java
 
-  if (aName.Find(NS_LITERAL_STRING("Facing back")) != kNotFound) {
+  if (mDeviceName.Find(NS_LITERAL_STRING("Facing back")) != kNotFound) {
     hasFacingMode = true;
     facingMode = VideoFacingModeEnum::Environment;
-  } else if (aName.Find(NS_LITERAL_STRING("Facing front")) != kNotFound) {
+  } else if (mDeviceName.Find(NS_LITERAL_STRING("Facing front")) != kNotFound) {
     hasFacingMode = true;
     facingMode = VideoFacingModeEnum::User;
   }
 #endif // ANDROID
 #ifdef XP_MACOSX
   // Kludge to test user-facing cameras on OSX.
-  if (aName.Find(NS_LITERAL_STRING("Face")) != -1) {
+  if (mDeviceName.Find(NS_LITERAL_STRING("Face")) != -1) {
     hasFacingMode = true;
     facingMode = VideoFacingModeEnum::User;
   }
 #endif
 #ifdef XP_WIN
   // The cameras' name of Surface book are "Microsoft Camera Front" and
   // "Microsoft Camera Rear" respectively.
 
-  if (aName.Find(NS_LITERAL_STRING("Front")) != kNotFound) {
+  if (mDeviceName.Find(NS_LITERAL_STRING("Front")) != kNotFound) {
     hasFacingMode = true;
     facingMode = VideoFacingModeEnum::User;
-  } else if (aName.Find(NS_LITERAL_STRING("Rear")) != kNotFound) {
+  } else if (mDeviceName.Find(NS_LITERAL_STRING("Rear")) != kNotFound) {
     hasFacingMode = true;
     facingMode = VideoFacingModeEnum::Environment;
   }
 #endif // WINDOWS
   if (hasFacingMode) {
     mFacingMode.Assign(NS_ConvertUTF8toUTF16(
         dom::VideoFacingModeEnumValues::strings[uint32_t(facingMode)].value));
   } else {