Bug 1244870 - initialization of err variable r=jya
authorJean-Luc Bonnafoux <jeanluc.bonnafoux@wanadoo.fr>
Tue, 24 Apr 2018 20:42:02 +0200
changeset 472000 64583d3e0f6fd6ec9049bea1039948ce871f4209
parent 471999 11a7d6db54859ff6733733c9b244ac16c54ec657
child 472001 4e857676a1a54ca6d8f3acc9883c66f4c88176d9
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1244870
milestone61.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 1244870 - initialization of err variable r=jya MozReview-Commit-ID: 6Zh7tqNdHeu
dom/media/platforms/omx/OmxPlatformLayer.cpp
--- a/dom/media/platforms/omx/OmxPlatformLayer.cpp
+++ b/dom/media/platforms/omx/OmxPlatformLayer.cpp
@@ -44,22 +44,20 @@ typedef OmxConfig<AudioInfo> OmxAudioCon
 typedef OmxConfig<VideoInfo> OmxVideoConfig;
 
 template<typename ConfigType>
 UniquePtr<ConfigType> ConfigForMime(const nsACString&);
 
 static OMX_ERRORTYPE
 ConfigAudioOutputPort(OmxPlatformLayer& aOmx, const AudioInfo& aInfo)
 {
-  OMX_ERRORTYPE err;
-
   OMX_PARAM_PORTDEFINITIONTYPE def;
   InitOmxParameter(&def);
   def.nPortIndex = aOmx.OutputPortIndex();
-  err = aOmx.GetParameter(OMX_IndexParamPortDefinition, &def, sizeof(def));
+  OMX_ERRORTYPE err = aOmx.GetParameter(OMX_IndexParamPortDefinition, &def, sizeof(def));
   RETURN_IF_ERR(err);
 
   def.format.audio.eEncoding = OMX_AUDIO_CodingPCM;
   err = aOmx.SetParameter(OMX_IndexParamPortDefinition, &def, sizeof(def));
   RETURN_IF_ERR(err);
 
   OMX_AUDIO_PARAM_PCMMODETYPE pcmParams;
   InitOmxParameter(&pcmParams);
@@ -82,22 +80,20 @@ ConfigAudioOutputPort(OmxPlatformLayer& 
   return OMX_ErrorNone;
 }
 
 class OmxAacConfig : public OmxAudioConfig
 {
 public:
   OMX_ERRORTYPE Apply(OmxPlatformLayer& aOmx, const AudioInfo& aInfo) override
   {
-    OMX_ERRORTYPE err;
-
     OMX_AUDIO_PARAM_AACPROFILETYPE aacProfile;
     InitOmxParameter(&aacProfile);
     aacProfile.nPortIndex = aOmx.InputPortIndex();
-    err = aOmx.GetParameter(OMX_IndexParamAudioAac, &aacProfile, sizeof(aacProfile));
+    OMX_ERRORTYPE err = aOmx.GetParameter(OMX_IndexParamAudioAac, &aacProfile, sizeof(aacProfile));
     RETURN_IF_ERR(err);
 
     aacProfile.nChannels = aInfo.mChannels;
     aacProfile.nSampleRate = aInfo.mRate;
     aacProfile.eAACProfile = static_cast<OMX_AUDIO_AACPROFILETYPE>(aInfo.mProfile);
     err = aOmx.SetParameter(OMX_IndexParamAudioAac, &aacProfile, sizeof(aacProfile));
     RETURN_IF_ERR(err);
 
@@ -108,22 +104,20 @@ public:
   }
 };
 
 class OmxMp3Config : public OmxAudioConfig
 {
 public:
   OMX_ERRORTYPE Apply(OmxPlatformLayer& aOmx, const AudioInfo& aInfo) override
   {
-    OMX_ERRORTYPE err;
-
     OMX_AUDIO_PARAM_MP3TYPE mp3Param;
     InitOmxParameter(&mp3Param);
     mp3Param.nPortIndex = aOmx.InputPortIndex();
-    err = aOmx.GetParameter(OMX_IndexParamAudioMp3, &mp3Param, sizeof(mp3Param));
+    OMX_ERRORTYPE err = aOmx.GetParameter(OMX_IndexParamAudioMp3, &mp3Param, sizeof(mp3Param));
     RETURN_IF_ERR(err);
 
     mp3Param.nChannels = aInfo.mChannels;
     mp3Param.nSampleRate = aInfo.mRate;
     err = aOmx.SetParameter(OMX_IndexParamAudioMp3, &mp3Param, sizeof(mp3Param));
     RETURN_IF_ERR(err);
 
     LOG("Config OMX_IndexParamAudioMp3, channel %lu, sample rate %lu",
@@ -139,22 +133,20 @@ enum OmxAmrSampleRate {
 };
 
 template <OmxAmrSampleRate R>
 class OmxAmrConfig : public OmxAudioConfig
 {
 public:
   OMX_ERRORTYPE Apply(OmxPlatformLayer& aOmx, const AudioInfo& aInfo) override
   {
-    OMX_ERRORTYPE err;
-
     OMX_AUDIO_PARAM_AMRTYPE def;
     InitOmxParameter(&def);
     def.nPortIndex = aOmx.InputPortIndex();
-    err = aOmx.GetParameter(OMX_IndexParamAudioAmr, &def, sizeof(def));
+    OMX_ERRORTYPE err = aOmx.GetParameter(OMX_IndexParamAudioAmr, &def, sizeof(def));
     RETURN_IF_ERR(err);
 
     def.eAMRFrameFormat = OMX_AUDIO_AMRFrameFormatFSF;
     err = aOmx.SetParameter(OMX_IndexParamAudioAmr, &def, sizeof(def));
     RETURN_IF_ERR(err);
 
     MOZ_ASSERT(aInfo.mChannels == 1);
     MOZ_ASSERT(aInfo.mRate == R);
@@ -191,17 +183,17 @@ class OmxCommonVideoConfig : public OmxV
 {
 public:
   explicit OmxCommonVideoConfig()
     : OmxVideoConfig()
   {}
 
   OMX_ERRORTYPE Apply(OmxPlatformLayer& aOmx, const VideoInfo& aInfo) override
   {
-    OMX_ERRORTYPE err;
+    OMX_ERRORTYPE err = OMX_ErrorNone;
     OMX_PARAM_PORTDEFINITIONTYPE def;
 
     // Set up in/out port definition.
     nsTArray<uint32_t> ports;
     aOmx.GetPortIndices(ports);
     for (auto idx : ports) {
       InitOmxParameter(&def);
       def.nPortIndex = idx;