Bug 1273965 part 2: Collapse & de-indent one else-after-return in MediaPipelineFactory.cpp, and drop a now-clearly-unnecessary NS_NOTREACHED. r=bwc
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 18 May 2016 10:55:58 -0700
changeset 298043 fb4a38912157551a21c0a3b5f7e6a912989fe7d4
parent 298042 82a22f492f566c951dea149f70c631237f930b66
child 298044 e449e783210d5225255361127461d8a7a643ac6a
push id30270
push userryanvm@gmail.com
push dateThu, 19 May 2016 16:47:16 +0000
treeherdermozilla-central@1806d405c871 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1273965
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 1273965 part 2: Collapse & de-indent one else-after-return in MediaPipelineFactory.cpp, and drop a now-clearly-unnecessary NS_NOTREACHED. r=bwc MozReview-Commit-ID: EJhWQf9DzyT
media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
--- a/media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
+++ b/media/webrtc/signaling/src/peerconnection/MediaPipelineFactory.cpp
@@ -992,30 +992,28 @@ MediaPipelineFactory::EnsureExternalCode
           OMXVideoCodec::CreateEncoder(OMXVideoCodec::CodecType::CODEC_H264);
 #else
       encoder = GmpVideoCodec::CreateEncoder();
 #endif
       if (encoder) {
         return aConduit.SetExternalSendCodec(aConfig, encoder);
       }
       return kMediaConduitInvalidSendCodec;
-    } else {
-      VideoDecoder* decoder = nullptr;
+    }
+    VideoDecoder* decoder = nullptr;
 #ifdef MOZ_WEBRTC_OMX
-      decoder =
-          OMXVideoCodec::CreateDecoder(OMXVideoCodec::CodecType::CODEC_H264);
+    decoder =
+      OMXVideoCodec::CreateDecoder(OMXVideoCodec::CodecType::CODEC_H264);
 #else
-      decoder = GmpVideoCodec::CreateDecoder();
+    decoder = GmpVideoCodec::CreateDecoder();
 #endif
-      if (decoder) {
-        return aConduit.SetExternalRecvCodec(aConfig, decoder);
-      }
-      return kMediaConduitInvalidReceiveCodec;
+    if (decoder) {
+      return aConduit.SetExternalRecvCodec(aConfig, decoder);
     }
-    NS_NOTREACHED("Shouldn't get here!");
+    return kMediaConduitInvalidReceiveCodec;
   } else {
     MOZ_MTLOG(ML_ERROR,
               "Invalid video codec configured: " << aConfig->mName.c_str());
     return aIsSend ? kMediaConduitInvalidSendCodec
                    : kMediaConduitInvalidReceiveCodec;
   }
 
   NS_NOTREACHED("Shouldn't get here!");