diff --git a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc index 1c177a8d5e..3235b0a0ca 100644 --- a/packager/media/codecs/h265_byte_to_unit_stream_converter.cc +++ b/packager/media/codecs/h265_byte_to_unit_stream_converter.cc @@ -74,21 +74,24 @@ bool H265ByteToUnitStreamConverter::GetDecoderConfigurationRecord( buffer.AppendInt(static_cast(kUnitStreamNaluLengthSize - 1)); buffer.AppendInt(static_cast(3) /* numOfArrays */); + // More parameter set NALUs may follow when strip_parameter_set_nalus is + // disabled. + const uint8_t array_completeness = strip_parameter_set_nalus() ? 0x80 : 0; + // VPS - const uint8_t kArrayCompleteness = 0x80; - buffer.AppendInt(static_cast(kArrayCompleteness | Nalu::H265_VPS)); + buffer.AppendInt(static_cast(array_completeness | Nalu::H265_VPS)); buffer.AppendInt(static_cast(1) /* numNalus */); buffer.AppendInt(static_cast(last_vps_.size())); buffer.AppendVector(last_vps_); // SPS - buffer.AppendInt(static_cast(kArrayCompleteness | Nalu::H265_SPS)); + buffer.AppendInt(static_cast(array_completeness | Nalu::H265_SPS)); buffer.AppendInt(static_cast(1) /* numNalus */); buffer.AppendInt(static_cast(last_sps_.size())); buffer.AppendVector(last_sps_); // PPS - buffer.AppendInt(static_cast(kArrayCompleteness | Nalu::H265_PPS)); + buffer.AppendInt(static_cast(array_completeness | Nalu::H265_PPS)); buffer.AppendInt(static_cast(1) /* numNalus */); buffer.AppendInt(static_cast(last_pps_.size())); buffer.AppendVector(last_pps_);