mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Fix premature nullness assertions
Issue: #6910 PiperOrigin-RevId: 291721229
This commit is contained in:
parent
4dddad831a
commit
8da0e27d2e
1 changed files with 23 additions and 19 deletions
|
|
@ -560,28 +560,32 @@ public final class H264Reader implements ElementaryStreamReader {
|
|||
}
|
||||
|
||||
private boolean isFirstVclNalUnitOfPicture(SliceHeaderData other) {
|
||||
if (!isComplete) {
|
||||
return false;
|
||||
}
|
||||
if (!other.isComplete) {
|
||||
return true;
|
||||
}
|
||||
// See ISO 14496-10 subsection 7.4.1.2.4.
|
||||
SpsData spsData = Assertions.checkStateNotNull(this.spsData);
|
||||
SpsData otherSpsData = Assertions.checkStateNotNull(other.spsData);
|
||||
return isComplete
|
||||
&& (!other.isComplete
|
||||
|| frameNum != other.frameNum
|
||||
|| picParameterSetId != other.picParameterSetId
|
||||
|| fieldPicFlag != other.fieldPicFlag
|
||||
|| (bottomFieldFlagPresent
|
||||
&& other.bottomFieldFlagPresent
|
||||
&& bottomFieldFlag != other.bottomFieldFlag)
|
||||
|| (nalRefIdc != other.nalRefIdc && (nalRefIdc == 0 || other.nalRefIdc == 0))
|
||||
|| (spsData.picOrderCountType == 0
|
||||
&& otherSpsData.picOrderCountType == 0
|
||||
&& (picOrderCntLsb != other.picOrderCntLsb
|
||||
|| deltaPicOrderCntBottom != other.deltaPicOrderCntBottom))
|
||||
|| (spsData.picOrderCountType == 1
|
||||
&& otherSpsData.picOrderCountType == 1
|
||||
&& (deltaPicOrderCnt0 != other.deltaPicOrderCnt0
|
||||
|| deltaPicOrderCnt1 != other.deltaPicOrderCnt1))
|
||||
|| idrPicFlag != other.idrPicFlag
|
||||
|| (idrPicFlag && idrPicId != other.idrPicId));
|
||||
return frameNum != other.frameNum
|
||||
|| picParameterSetId != other.picParameterSetId
|
||||
|| fieldPicFlag != other.fieldPicFlag
|
||||
|| (bottomFieldFlagPresent
|
||||
&& other.bottomFieldFlagPresent
|
||||
&& bottomFieldFlag != other.bottomFieldFlag)
|
||||
|| (nalRefIdc != other.nalRefIdc && (nalRefIdc == 0 || other.nalRefIdc == 0))
|
||||
|| (spsData.picOrderCountType == 0
|
||||
&& otherSpsData.picOrderCountType == 0
|
||||
&& (picOrderCntLsb != other.picOrderCntLsb
|
||||
|| deltaPicOrderCntBottom != other.deltaPicOrderCntBottom))
|
||||
|| (spsData.picOrderCountType == 1
|
||||
&& otherSpsData.picOrderCountType == 1
|
||||
&& (deltaPicOrderCnt0 != other.deltaPicOrderCnt0
|
||||
|| deltaPicOrderCnt1 != other.deltaPicOrderCnt1))
|
||||
|| idrPicFlag != other.idrPicFlag
|
||||
|| (idrPicFlag && idrPicId != other.idrPicId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue