Fix H265Reader to correctly output SEI and AUD NAL units

Issue: #7113
PiperOrigin-RevId: 307380133
This commit is contained in:
olly 2020-04-20 13:25:43 +01:00 committed by Oliver Woodman
parent 190d81f0f6
commit a697905cfb
2 changed files with 6 additions and 5 deletions

View File

@ -13,6 +13,8 @@
`http://dashif.org/guidelines/trickmode`) into the same `TrackGroup` as
the main adaptation sets to which they refer. Trick play tracks are
marked with the `C.ROLE_FLAG_TRICK_PLAY` flag.
* MPEG-TS: Fix issue where SEI NAL units were incorrectly dropped from H.265
samples ([#7113](https://github.com/google/ExoPlayer/issues/7113)).
### 2.11.4 (2020-04-08) ###

View File

@ -41,6 +41,7 @@ public final class H265Reader implements ElementaryStreamReader {
private static final int VPS_NUT = 32;
private static final int SPS_NUT = 33;
private static final int PPS_NUT = 34;
private static final int AUD_NUT = 35;
private static final int PREFIX_SEI_NUT = 39;
private static final int SUFFIX_SEI_NUT = 40;
@ -445,7 +446,7 @@ public final class H265Reader implements ElementaryStreamReader {
}
}
// Look for the flag if this NAL unit contains a slice_segment_layer_rbsp.
// Look for the first slice flag if this NAL unit contains a slice_segment_layer_rbsp.
nalUnitHasKeyframeData = (nalUnitType >= BLA_W_LP && nalUnitType <= CRA_NUT);
lookingForFirstSliceFlag = nalUnitHasKeyframeData || nalUnitType <= RASL_R;
}
@ -489,14 +490,12 @@ public final class H265Reader implements ElementaryStreamReader {
/** Returns whether a NAL unit type is one that occurs before any VCL NAL units in a sample. */
private static boolean isPrefixNalUnit(int nalUnitType) {
// TODO: Include AUD_NUT and PREFIX_SEI_NUT
return VPS_NUT <= nalUnitType && nalUnitType <= PPS_NUT;
return (VPS_NUT <= nalUnitType && nalUnitType <= AUD_NUT) || nalUnitType == PREFIX_SEI_NUT;
}
/** Returns whether a NAL unit type is one that occurs in the VLC body of a sample. */
private static boolean isVclBodyNalUnit(int nalUnitType) {
// TODO: Include SUFFIX_SEI_NUT
return nalUnitType < VPS_NUT;
return nalUnitType < VPS_NUT || nalUnitType == SUFFIX_SEI_NUT;
}
}
}