Fix a subsample incorrect size bug in mp4 encryption

Clear size was not correctly calculated for non-video slice nal units.

Change-Id: I8371973a4ae346cbe4c1891ab274fb7a86983db8
This commit is contained in:
KongQun Yang 2016-03-14 17:42:40 -07:00
parent 1863f5a569
commit ef81be5f7b
2 changed files with 2 additions and 1 deletions

View File

@ -257,7 +257,8 @@ Status EncryptingFragmenter::EncryptSample(scoped_refptr<MediaSample> sample) {
accumulated_clear_bytes = 0; accumulated_clear_bytes = 0;
} else { } else {
// For non-video-slice NAL units, don't encrypt. // For non-video-slice NAL units, don't encrypt.
accumulated_clear_bytes += nalu.header_size() + nalu.payload_size(); accumulated_clear_bytes +=
nalu_length_size_ + nalu.header_size() + nalu.payload_size();
} }
} }
if (result != NaluReader::kEOStream) if (result != NaluReader::kEOStream)