diff options
author | James Dong <jdong@google.com> | 2012-01-30 11:51:54 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-01-30 11:51:54 -0800 |
commit | 2985773cff8a4984ede9985cf4aad9ce655ffd45 (patch) | |
tree | 3ab04d6f68fdecc927ec8e346b95eedc649da4a2 /libvideoeditor | |
parent | 3bd45591402b94ed4481ea0ee0a9140840979c84 (diff) | |
parent | c84b947d802116d64ca11087cfbc52fabd3c7109 (diff) | |
download | frameworks_av-2985773cff8a4984ede9985cf4aad9ce655ffd45.zip frameworks_av-2985773cff8a4984ede9985cf4aad9ce655ffd45.tar.gz frameworks_av-2985773cff8a4984ede9985cf4aad9ce655ffd45.tar.bz2 |
Merge "Fix an error to deal with 0-size nal units in some AVC files"
Diffstat (limited to 'libvideoeditor')
-rwxr-xr-x | libvideoeditor/vss/mcs/src/M4MCS_API.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/libvideoeditor/vss/mcs/src/M4MCS_API.c b/libvideoeditor/vss/mcs/src/M4MCS_API.c index 3844630..c056ef0 100755 --- a/libvideoeditor/vss/mcs/src/M4MCS_API.c +++ b/libvideoeditor/vss/mcs/src/M4MCS_API.c @@ -1337,21 +1337,8 @@ M4OSA_ERR H264MCS_ProcessSPS_PPS( NSWAVC_MCS_t *instance, M4OSA_UInt8 *inbuff, M4OSA_DEBUG_IF2((M4OSA_NULL == instance), M4ERR_PARAMETER, "H264MCS_ProcessSPS_PPS: instance is M4OSA_NULL"); - switch( instance->m_pDecoderSpecificInfo[4] & 0x3 ) - { - case 0: - instance->m_Num_Bytes_NALUnitLength = 1; - break; - - case 1: - instance->m_Num_Bytes_NALUnitLength = 2; - break; - - case 3: - //Note: Current code supports only this... - instance->m_Num_Bytes_NALUnitLength = 4; - break; - } + instance->m_Num_Bytes_NALUnitLength = + (instance->m_pDecoderSpecificInfo[4] & 0x03) + 1; instance->m_encoder_SPS_Cnt = instance->m_pDecoderSpecificInfo[5] & 0x1F; @@ -1428,6 +1415,12 @@ M4OSA_ERR H264MCS_ProcessSPS_PPS( NSWAVC_MCS_t *instance, M4OSA_UInt8 *inbuff, break; } + if (nal_size == 0) { + M4OSA_TRACE1_1("0 size nal unit at line %d", __LINE__); + frame_size += instance->m_Num_Bytes_NALUnitLength; + continue; + } + p_bs->bitPos = 0; p_bs->lastTotalBits = 0; p_bs->numBitsInBuffer = |