aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher R. Palmer <crpalmer@gmail.com>2016-01-13 14:57:45 -0500
committerJason Riordan <jriordan001@gmail.com>2016-01-13 18:08:26 -0500
commit43ccd58c53e951e3a5ec283711266e5aa9a2ebcc (patch)
tree09ba76a4d3e215ff9377323badabaed1b9fbaf6e
parent1338ce03fd97a876ce66fcf5670aa4a8a0f18654 (diff)
downloadandroid_hardware_intel_common_omx-components-43ccd58c53e951e3a5ec283711266e5aa9a2ebcc.tar.gz
android_hardware_intel_common_omx-components-43ccd58c53e951e3a5ec283711266e5aa9a2ebcc.tar.bz2
android_hardware_intel_common_omx-components-43ccd58c53e951e3a5ec283711266e5aa9a2ebcc.zip
Prior to this change the code used uninitialized memory to for the majority of the config. The commit message which added this code suggests that they might not have been using this function other than to pass a test suite? Either way, it can't be a bad change to get the old config as default values rather than using uninitialized memory when calling set config. Change-Id: I1ccec4a4f206f81af3127f442fdb8b0cfdcab1ad
-rw-r--r--videocodec/OMXVideoEncoderBase.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/videocodec/OMXVideoEncoderBase.cpp b/videocodec/OMXVideoEncoderBase.cpp
index 37f53d2..82cc741 100644
--- a/videocodec/OMXVideoEncoderBase.cpp
+++ b/videocodec/OMXVideoEncoderBase.cpp
@@ -964,6 +964,13 @@ OMX_ERRORTYPE OMXVideoEncoderBase::SetConfigVideoBitrate(OMX_PTR pStructure){
// CHECK_SET_CONFIG_STATE();
VideoConfigBitRate configBitRate;
+ if (mVideoEncoder->getConfig(&configBitRate) != ENCODE_SUCCESS) {
+ /* Ignoring the error here sucks, but prior to this change
+ * we were just using an uninitialized chunk of memory anyway
+ * so we aren't making anything worse and it makes this change safer.
+ */
+ LOGW("failed to get IntelBitrate");
+ }
configBitRate.rcParams.bitRate = mConfigBitrate.nEncodeBitrate;
configBitRate.rcParams.temporalID = 0;
retStatus = mVideoEncoder->setConfig(&configBitRate);