Fix a precision conversion problem.

- This causes a compilation error on Windows.

Change-Id: I53c03841565be00ebaa3acbfe621bb145f8f1ca2
This commit is contained in:
Haoming Chen 2016-09-08 17:19:11 -07:00
parent c91fe34fbe
commit 03d7a81c83
1 changed files with 6 additions and 2 deletions

View File

@ -219,7 +219,9 @@ bool NalUnitToByteStreamConverter::ConvertUnitToByteStreamWithSubsamples(
}
if (is_nalu_all_clear) {
// If AUD/SPS/PPS is all clear, reduce the clear bytes.
subsamples->at(subsample_id).clear_bytes -= old_nalu_size;
DCHECK_LT(old_nalu_size, subsamples->at(subsample_id).clear_bytes);
subsamples->at(subsample_id).clear_bytes -=
static_cast<uint16_t>(old_nalu_size);
} else {
// If AUD/SPS/PPS has cipher, drop the corresponding subsample.
subsamples->erase(subsamples->begin() + subsample_id);
@ -240,7 +242,9 @@ bool NalUnitToByteStreamConverter::ConvertUnitToByteStreamWithSubsamples(
}
if (is_nalu_all_clear) {
// Add this nalu to the adjustment and remove it from clear_bytes.
subsamples->at(subsample_id).clear_bytes -= old_nalu_size;
DCHECK_LT(old_nalu_size, subsamples->at(subsample_id).clear_bytes);
subsamples->at(subsample_id).clear_bytes -=
static_cast<uint16_t>(old_nalu_size);
adjustment += old_nalu_size;
} else {
// Apply the adjustment on the current subsample, reset the