diff --git a/packager/media/codecs/h264_parser.cc b/packager/media/codecs/h264_parser.cc index 05ac28324f..bd2189cd61 100644 --- a/packager/media/codecs/h264_parser.cc +++ b/packager/media/codecs/h264_parser.cc @@ -103,22 +103,6 @@ bool H264SliceHeader::IsSISlice() const { return (slice_type % 5 == kSISlice); } -H264Sps::H264Sps() { - memset(this, 0, sizeof(*this)); -} - -H264Pps::H264Pps() { - memset(this, 0, sizeof(*this)); -} - -H264SliceHeader::H264SliceHeader() { - memset(this, 0, sizeof(*this)); -} - -H264SEIMessage::H264SEIMessage() { - memset(this, 0, sizeof(*this)); -} - #define READ_BITS_OR_RETURN(num_bits, out) \ do { \ if (!br->ReadBits(num_bits, (out))) { \ @@ -991,7 +975,7 @@ H264Parser::Result H264Parser::ParseSliceHeader(const Nalu& nalu, reader.Initialize(nalu.data() + nalu.header_size(), nalu.payload_size()); H26xBitReader* br = &reader; - memset(reinterpret_cast(shdr), 0, sizeof(*shdr)); + *shdr = {}; shdr->idr_pic_flag = (nalu.type() == 5); shdr->nal_ref_idc = nalu.ref_idc(); @@ -1137,7 +1121,7 @@ H264Parser::Result H264Parser::ParseSEI(const Nalu& nalu, reader.Initialize(nalu.data() + nalu.header_size(), nalu.payload_size()); H26xBitReader* br = &reader; - memset(reinterpret_cast(sei_msg), 0, sizeof(*sei_msg)); + *sei_msg = {}; READ_BITS_OR_RETURN(8, &byte); while (byte == 0xff) { diff --git a/packager/media/codecs/h264_parser.h b/packager/media/codecs/h264_parser.h index 52118b7c66..82772d45ee 100644 --- a/packager/media/codecs/h264_parser.h +++ b/packager/media/codecs/h264_parser.h @@ -35,8 +35,6 @@ enum { }; struct H264Sps { - H264Sps(); - int profile_idc; bool constraint_set0_flag; bool constraint_set1_flag; @@ -92,8 +90,6 @@ struct H264Sps { }; struct H264Pps { - H264Pps(); - int pic_parameter_set_id; int seq_parameter_set_id; bool entropy_coding_mode_flag; @@ -144,8 +140,6 @@ struct H264DecRefPicMarking { }; struct H264SliceHeader { - H264SliceHeader(); - enum { kRefListSize = 32, kRefListModSize = kRefListSize @@ -230,8 +224,6 @@ struct H264SEIRecoveryPoint { }; struct H264SEIMessage { - H264SEIMessage(); - enum Type { kSEIRecoveryPoint = 6, };