diff options
author | Ashok Bhat <ashok.bhat@arm.com> | 2014-07-02 17:11:04 +0100 |
---|---|---|
committer | Ashok Bhat <ashok.bhat@arm.com> | 2014-07-09 14:14:24 +0100 |
commit | 9af4f0026d1bfff9ff5688b67a8730103f5ece2f (patch) | |
tree | 0e9f27aa231c2bb7c8e3033ddb884ebd8fa32955 | |
parent | bc0c2c2d2a4cc058ab404f940f0ca65f595e047b (diff) | |
download | frameworks_av-9af4f0026d1bfff9ff5688b67a8730103f5ece2f.zip frameworks_av-9af4f0026d1bfff9ff5688b67a8730103f5ece2f.tar.gz frameworks_av-9af4f0026d1bfff9ff5688b67a8730103f5ece2f.tar.bz2 |
Fix in SoftAVCEncoder plugin
size of buffer_handle_t, a pointer type, was assumed to be
4 bytes. This patch uses sizeof(buffer_handle_t) instead.
In addition, replaced magic number 4 with sizeof(OMX_U32)
Change-Id: Id5a7ed805a7b8e9867d8e51655cd334a66ac2c2b
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
-rw-r--r-- | media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp index 89f0fed..9d2064d 100644 --- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp +++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp @@ -819,9 +819,10 @@ void SoftAVCEncoder::onQueueFilled(OMX_U32 portIndex) { videoInput.coding_timestamp = (inHeader->nTimeStamp + 500) / 1000; // in ms uint8_t *inputData = NULL; if (mStoreMetaDataInBuffers) { - if (inHeader->nFilledLen != 8) { + if (inHeader->nFilledLen != (sizeof(OMX_U32) + sizeof(buffer_handle_t))) { ALOGE("MetaData buffer is wrong size! " - "(got %u bytes, expected 8)", inHeader->nFilledLen); + "(got %u bytes, expected %d)", inHeader->nFilledLen, + sizeof(OMX_U32) + sizeof(buffer_handle_t)); mSignalledError = true; notify(OMX_EventError, OMX_ErrorUndefined, 0, 0); return; @@ -985,7 +986,7 @@ uint8_t *SoftAVCEncoder::extractGrallocData(void *data, buffer_handle_t *buffer) kMetadataBufferTypeGrallocSource, type); return NULL; } - buffer_handle_t imgBuffer = *(buffer_handle_t*)((uint8_t*)data + 4); + buffer_handle_t imgBuffer = *(buffer_handle_t*)((uint8_t*)data + sizeof(OMX_U32)); const Rect rect(mVideoWidth, mVideoHeight); uint8_t *img; |