diff options
author | Christopher R. Palmer <crpalmer@gmail.com> | 2016-01-13 14:57:45 -0500 |
---|---|---|
committer | Jason Riordan <jriordan001@gmail.com> | 2016-01-13 18:08:26 -0500 |
commit | 43ccd58c53e951e3a5ec283711266e5aa9a2ebcc (patch) | |
tree | 09ba76a4d3e215ff9377323badabaed1b9fbaf6e /videocodec/OMXVideoEncoderBase.cpp | |
parent | 1338ce03fd97a876ce66fcf5670aa4a8a0f18654 (diff) | |
download | android_hardware_intel_common_omx-components-28ccb46c2a1b30afd0b32b22f92dd44063aa8b9f.tar.gz android_hardware_intel_common_omx-components-28ccb46c2a1b30afd0b32b22f92dd44063aa8b9f.tar.bz2 android_hardware_intel_common_omx-components-28ccb46c2a1b30afd0b32b22f92dd44063aa8b9f.zip |
intel: omx: Unbreak SetConfigVideoBitrateHEADreplicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004-rc4replicant-6.0-0004-rc3replicant-6.0-0004-rc2replicant-6.0-0004-rc1replicant-6.0-0004replicant-6.0-0003replicant-6.0-0002replicant-6.0-0001stable/cm-13.0-ZNH5Ystable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2Kstable/cm-13.0-ZNH0Ecm-13.0
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
Diffstat (limited to 'videocodec/OMXVideoEncoderBase.cpp')
-rw-r--r-- | videocodec/OMXVideoEncoderBase.cpp | 7 |
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); |