From 8854bfbcc40ad3c3fe2823a58b50ea91a4ed256e Mon Sep 17 00:00:00 2001 From: jcdr428 Date: Tue, 4 Jan 2022 22:36:55 +0100 Subject: [PATCH] Initialize local variables --- tsMuxer/bitStream.cpp | 6 ++-- tsMuxer/bitStream.h | 2 +- tsMuxer/dvbSubStreamReader.cpp | 2 +- tsMuxer/h264StreamReader.cpp | 6 ++-- tsMuxer/hevc.cpp | 2 +- tsMuxer/hevcStreamReader.cpp | 2 +- tsMuxer/mpeg2StreamReader.cpp | 8 +++--- tsMuxer/mpegVideo.cpp | 12 ++++---- tsMuxer/nalUnits.cpp | 22 +++++++-------- tsMuxer/tsDemuxer.cpp | 6 ++-- tsMuxer/tsMuxer.cpp | 2 +- tsMuxer/tsPacket.cpp | 50 +++++++++++++++++----------------- tsMuxer/vvc.cpp | 2 +- 13 files changed, 61 insertions(+), 61 deletions(-) diff --git a/tsMuxer/bitStream.cpp b/tsMuxer/bitStream.cpp index 0720626..63047e0 100644 --- a/tsMuxer/bitStream.cpp +++ b/tsMuxer/bitStream.cpp @@ -13,7 +13,7 @@ void updateBits(const BitStreamReader& bitReader, int bitOffset, int bitLen, int void updateBits(const uint8_t* buffer, int bitOffset, int bitLen, int value) { uint8_t* ptr = (uint8_t*)buffer + bitOffset / 8; - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; int byteOffset = bitOffset % 8; bitWriter.setBuffer(ptr, ptr + (bitLen / 8 + 5)); @@ -38,10 +38,10 @@ void updateBits(const uint8_t* buffer, int bitOffset, int bitLen, int value) void moveBits(uint8_t* buffer, int oldBitOffset, int newBitOffset, int len) { uint8_t* src = (uint8_t*)buffer + (oldBitOffset >> 3); - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(src, src + len / 8 + 1); uint8_t* dst = (uint8_t*)buffer + (newBitOffset >> 3); - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(dst, dst + len / 8 + 1); writer.skipBits(newBitOffset % 8); if (oldBitOffset % 8) diff --git a/tsMuxer/bitStream.h b/tsMuxer/bitStream.h index 31bd29c..581ab03 100644 --- a/tsMuxer/bitStream.h +++ b/tsMuxer/bitStream.h @@ -173,7 +173,7 @@ class BitStreamWriter : public BitStream inline void skipBits(unsigned cnt) { assert(m_bitWrited % INT_BIT == 0); - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer((uint8_t*)m_buffer, (uint8_t*)(m_buffer + 1)); putBits(cnt, reader.getBits(cnt)); } diff --git a/tsMuxer/dvbSubStreamReader.cpp b/tsMuxer/dvbSubStreamReader.cpp index 1a6b51a..1c5466f 100644 --- a/tsMuxer/dvbSubStreamReader.cpp +++ b/tsMuxer/dvbSubStreamReader.cpp @@ -41,7 +41,7 @@ int DVBSubStreamReader::intDecodeFrame(uint8_t* buff, uint8_t* end) int pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos; int cmd_pos, is_8bit = 0; const uint8_t* yuv_palette = 0; - uint8_t colormap[4], alpha[256]; + uint8_t colormap[4]{0}, alpha[256]{0}; int date; int i; int is_menu = 0; diff --git a/tsMuxer/h264StreamReader.cpp b/tsMuxer/h264StreamReader.cpp index fafd8b1..cbbe766 100644 --- a/tsMuxer/h264StreamReader.cpp +++ b/tsMuxer/h264StreamReader.cpp @@ -82,7 +82,7 @@ CheckStreamRez H264StreamReader::checkStream(uint8_t* buffer, int len) std::string tmpDescr; bool pulldownInserted = false; bool offsetsInserted = false; - BitStreamReader bitReader; + BitStreamReader bitReader{}; m_last_mb_num = -1; for (uint8_t* nal = NALUnit::findNextNAL(buffer, end); nal < end - 4; nal = NALUnit::findNextNAL(nal, end)) @@ -225,7 +225,7 @@ int H264StreamReader::writeSEIMessage(uint8_t* dstBuffer, uint8_t* dstEnd, SEIUn THROW(ERR_COMMON, "H264 stream error: Not enough buffer for write headers"); uint8_t tmpBuffer[256]; - BitStreamWriter writer; + BitStreamWriter writer{}; curPos = writeNalPrefix(curPos); writer.setBuffer(tmpBuffer, tmpBuffer + sizeof(tmpBuffer)); @@ -1068,7 +1068,7 @@ bool H264StreamReader::findPPSForward(uint8_t* buff) int H264StreamReader::deserializeSliceHeader(SliceUnit& slice, uint8_t* buff, uint8_t* sliceEnd) { - int nalRez; + int nalRez{}; int maxHeaderSize = sliceEnd - buff; int toDecode = 0; do diff --git a/tsMuxer/hevc.cpp b/tsMuxer/hevc.cpp index a2c608f..d613e71 100644 --- a/tsMuxer/hevc.cpp +++ b/tsMuxer/hevc.cpp @@ -64,7 +64,7 @@ int HevcUnit::deserialize() void HevcUnit::updateBits(int bitOffset, int bitLen, int value) { uint8_t* ptr = (uint8_t*)m_reader.getBuffer() + bitOffset / 8; - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; int byteOffset = bitOffset % 8; bitWriter.setBuffer(ptr, ptr + (bitLen / 8 + 5)); diff --git a/tsMuxer/hevcStreamReader.cpp b/tsMuxer/hevcStreamReader.cpp index 19b1d8d..44d99dc 100644 --- a/tsMuxer/hevcStreamReader.cpp +++ b/tsMuxer/hevcStreamReader.cpp @@ -332,7 +332,7 @@ int HEVCStreamReader::setDoViDescriptor(uint8_t* dstBuff) else if (width <= 7680 && pixelRate <= 3981312000) level = 13; - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; bitWriter.setBuffer(dstBuff, dstBuff + 128); bitWriter.putBits(8, 0xb0); // DoVi descriptor tag diff --git a/tsMuxer/mpeg2StreamReader.cpp b/tsMuxer/mpeg2StreamReader.cpp index 00f1298..980b737 100644 --- a/tsMuxer/mpeg2StreamReader.cpp +++ b/tsMuxer/mpeg2StreamReader.cpp @@ -25,7 +25,7 @@ int MPEG2StreamReader::getTSDescriptor(uint8_t* dstBuff, bool blurayMode, bool h } else if (nal[3] == EXT_START_SHORT_CODE) { - BitStreamReader bitReader; + BitStreamReader bitReader{}; bitReader.setBuffer(nal + 4, m_bufEnd); int extType = bitReader.getBits(4); if (extType == SEQUENCE_EXT) @@ -65,7 +65,7 @@ CheckStreamRez MPEG2StreamReader::checkStream(uint8_t* buffer, int len) { CheckStreamRez rez; uint8_t* end = buffer + len; - BitStreamReader bitReader; + BitStreamReader bitReader{}; uint8_t* nextNal = 0; bool spsFound = false; bool iFrameFound = false; @@ -226,7 +226,7 @@ int MPEG2StreamReader::processSeqStartCode(uint8_t* buff) int MPEG2StreamReader::processExtStartCode(uint8_t* buff) { - BitStreamReader bitReader; + BitStreamReader bitReader{}; try { bitReader.setBuffer(buff + 1, m_bufEnd); @@ -325,7 +325,7 @@ int MPEG2StreamReader::findFrameExt(uint8_t* buffer) { if (nal[3] == EXT_START_SHORT_CODE) { - BitStreamReader bitReader; + BitStreamReader bitReader{}; try { bitReader.setBuffer(nal + 4, m_bufEnd); diff --git a/tsMuxer/mpegVideo.cpp b/tsMuxer/mpegVideo.cpp index 49e87d2..6248c8c 100644 --- a/tsMuxer/mpegVideo.cpp +++ b/tsMuxer/mpegVideo.cpp @@ -68,7 +68,7 @@ MPEGSequenceHeader::MPEGSequenceHeader(int bufferSize) : MPEGRawDataHeader(buffe uint8_t* MPEGSequenceHeader::deserialize(uint8_t* buf, int buf_size) { - BitStreamReader bitReader; + BitStreamReader bitReader{}; bitReader.setBuffer(buf, buf + buf_size); width = bitReader.getBits(12); @@ -308,7 +308,7 @@ void MPEGSequenceHeader::setAspectRatio(uint8_t* buff, VideoAspectRatio ar) // --------------- gop header ------------------ uint8_t* MPEGGOPHeader::deserialize(uint8_t* buf, int buf_size) { - BitStreamReader bitReader; + BitStreamReader bitReader{}; bitReader.setBuffer(buf, buf + buf_size); drop_frame_flag = bitReader.getBit(); @@ -336,7 +336,7 @@ if(s->avctx->debug & FF_DEBUG_PICT_INFO) uint32_t MPEGGOPHeader::serialize(uint8_t* buffer) { - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; // init_bitWriter.putBits(buffer, 8*8); // 8*8 maximum gop header buffer size at bits bitWriter.setBuffer(buffer, buffer + 8); bitWriter.putBits(1, drop_frame_flag); @@ -371,7 +371,7 @@ MPEGPictureHeader::MPEGPictureHeader(int bufferSize) void MPEGPictureHeader::buildHeader() { - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; // init_bitWriter.putBits(m_data_buffer, m_max_data_len*8); bitWriter.setBuffer(m_data_buffer, m_data_buffer + m_max_data_len); @@ -400,7 +400,7 @@ void MPEGPictureHeader::buildHeader() void MPEGPictureHeader::buildCodingExtension() { - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; // init_bitWriter.putBits(m_data_buffer + m_data_buffer_len, (m_max_data_len - m_data_buffer_len)*8); uint8_t* bufPtr = m_data_buffer + m_data_buffer_len; bitWriter.setBuffer(bufPtr, bufPtr + m_max_data_len - m_data_buffer_len); @@ -621,7 +621,7 @@ uint32_t MPEGPictureHeader::serialize(uint8_t* buffer) void MPEGSliceHeader::deserialize(uint8_t* buf, int buf_size) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buf, buf + buf_size); quantiser_scale_code = reader.getBits(5); if (reader.getBit()) diff --git a/tsMuxer/nalUnits.cpp b/tsMuxer/nalUnits.cpp index cf904c5..dada834 100644 --- a/tsMuxer/nalUnits.cpp +++ b/tsMuxer/nalUnits.cpp @@ -196,7 +196,7 @@ int NALUnit::decodeNAL2(uint8_t* srcBuffer, uint8_t* srcEnd, uint8_t* dstBuffer, unsigned NALUnit::extractUEGolombCode(uint8_t* buffer, uint8_t* bufEnd) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, bufEnd); return extractUEGolombCode(reader); } @@ -601,10 +601,10 @@ int SPSUnit::deserialize() int seq_scaling_matrix_present_flag = bitReader.getBits(1); if (seq_scaling_matrix_present_flag != 0) { - int ScalingList4x4[6][16]; - int ScalingList8x8[2][64]; - bool UseDefaultScalingMatrix4x4Flag[6]; - bool UseDefaultScalingMatrix8x8Flag[2]; + int ScalingList4x4[6][16]{}; + int ScalingList8x8[2][64]{}; + bool UseDefaultScalingMatrix4x4Flag[6]{}; + bool UseDefaultScalingMatrix8x8Flag[2]{}; for (int i = 0; i < 8; i++) { @@ -900,9 +900,9 @@ void SPSUnit::updateTimingInfo() int beforeBytes = bitPos >> 3; memcpy(newNalBuffer, m_nalBuffer, m_nalBufferLen); - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(m_nalBuffer + beforeBytes, m_nalBuffer + m_nalBufferLen); - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(newNalBuffer + beforeBytes, newNalBuffer + m_nalBufferLen + EXTRA_SPACE); int tmpVal = reader.getBits(bitPos & 7); writer.putBits(bitPos & 7, tmpVal); @@ -958,9 +958,9 @@ void SPSUnit::insertHrdData(int bitPos, int nal_hrd_len, int vcl_hrd_len, bool a int beforeBytes = bitPos >> 3; memcpy(newNalBuffer, m_nalBuffer, m_nalBufferLen); - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(m_nalBuffer + beforeBytes, m_nalBuffer + m_nalBufferLen); - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(newNalBuffer + beforeBytes, newNalBuffer + m_nalBufferLen + EXTRA_SPACE); int tmpVal = reader.getBits(bitPos & 7); writer.putBits(bitPos & 7, tmpVal); @@ -1447,7 +1447,7 @@ void NALUnit::updateBits(int bitOffset, int bitLen, int value) { // uint8_t* ptr = m_getbitContextBuffer + (bitOffset/8); uint8_t* ptr = (uint8_t*)bitReader.getBuffer() + bitOffset / 8; - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; int byteOffset = bitOffset % 8; bitWriter.setBuffer(ptr, ptr + (bitLen / 8 + 5)); @@ -2071,7 +2071,7 @@ int SEIUnit::removePicTimingSEI(SPSUnit& sps) { uint8_t* nalEnd = m_nalBuffer + m_nalBufferLen; uint8_t* curBuff = m_nalBuffer + 1; - uint8_t tmpBuffer[1024 * 4]; + uint8_t tmpBuffer[1024 * 4]{}; tmpBuffer[0] = m_nalBuffer[0]; int tmpBufferLen = 1; diff --git a/tsMuxer/tsDemuxer.cpp b/tsMuxer/tsDemuxer.cpp index 2e554ab..7b86b7a 100644 --- a/tsMuxer/tsDemuxer.cpp +++ b/tsMuxer/tsDemuxer.cpp @@ -56,7 +56,7 @@ bool TSDemuxer::mvcContinueExpected() const void TSDemuxer::getTrackList(std::map& trackList) { - uint8_t pmtBuffer[4096]; + uint8_t pmtBuffer[4096]{0}; int pmtBufferLen = 0; uint32_t tmpBufferLen = 0; uint32_t readedBytes; @@ -195,7 +195,7 @@ int TSDemuxer::simpleDemuxBlock(DemuxedData& demuxedData, const PIDSet& accepted m_firstDemuxCall = false; } - uint8_t pmtBuffer[4096]; + uint8_t pmtBuffer[4096]{0}; int pmtBufferLen = 0; MemoryBlock* vect = 0; int lastPid = -1; @@ -561,7 +561,7 @@ int64_t getTSDuration(const char* fileName) } delete[] tmpBuffer; - int64_t lastPcrVal; + int64_t lastPcrVal{}; bufferSize = 1024 * 256; bufferSize -= bufferSize % frameSize; do diff --git a/tsMuxer/tsMuxer.cpp b/tsMuxer/tsMuxer.cpp index b0a98c3..dfc3368 100644 --- a/tsMuxer/tsMuxer.cpp +++ b/tsMuxer/tsMuxer.cpp @@ -633,7 +633,7 @@ void TSMuxer::buildPesHeader(int pesStreamID, AVPacket& avPacket, int pid) { int64_t curDts = nanoClockToPts(avPacket.dts) + m_timeOffset; int64_t curPts = nanoClockToPts(avPacket.pts) + m_timeOffset; - uint8_t tmpBuffer[2048]; + uint8_t tmpBuffer[2048]{0}; PESPacket* pesPacket = (PESPacket*)tmpBuffer; if (curDts != curPts) pesPacket->serialize(curPts, curDts, pesStreamID); diff --git a/tsMuxer/tsPacket.cpp b/tsMuxer/tsPacket.cpp index f2229d0..791ec90 100644 --- a/tsMuxer/tsPacket.cpp +++ b/tsMuxer/tsPacket.cpp @@ -42,7 +42,7 @@ bool isAudioStreamType(int stream_coding_type) bool PS_stream_pack::deserialize(uint8_t* buffer, int buf_size) { m_pts = 0; - BitStreamReader bitReader; + BitStreamReader bitReader{}; bitReader.setBuffer(buffer, buffer + buf_size); if (bitReader.getBits(2) != 1) return false; // 0b01 required @@ -96,7 +96,7 @@ bool TS_program_association_section::deserialize(uint8_t* buffer, int buf_size) { m_nitPID = -1; buffer++; - BitStreamReader bitReader; + BitStreamReader bitReader{}; try { bitReader.setBuffer(buffer, buffer + buf_size); @@ -151,7 +151,7 @@ uint32_t TS_program_association_section::serialize(uint8_t* buffer, int buf_size { buffer[0] = 0; buffer++; - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; // init_bitWriter.putBits(buffer, buf_size*8); bitWriter.setBuffer(buffer, buffer + buf_size); @@ -200,7 +200,7 @@ bool TS_program_map_section::isFullBuff(uint8_t* buffer, int buf_size) { uint8_t pointerField = *buffer; uint8_t* bufEnd = buffer + buf_size; - BitStreamReader bitReader; + BitStreamReader bitReader{}; try { bitReader.setBuffer(buffer + 1 + pointerField, buffer + buf_size); @@ -250,7 +250,7 @@ bool TS_program_map_section::deserialize(uint8_t* buffer, int buf_size) return false; uint8_t pointerField = *buffer; uint8_t* bufferEnd = buffer + buf_size; - BitStreamReader bitReader; + BitStreamReader bitReader{}; try { bitReader.setBuffer(buffer + 1 + pointerField, buffer + buf_size); @@ -374,7 +374,7 @@ uint32_t TS_program_map_section::serialize(uint8_t* buffer, int max_buf_size, bo { buffer[0] = 0; buffer++; - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; bitWriter.setBuffer(buffer, buffer + max_buf_size); bitWriter.putBits(8, 2); // table id @@ -626,7 +626,7 @@ void CLPIStreamInfo::composeStreamCodingInfo(BitStreamWriter& writer) const void CLPIParser::parseProgramInfo(uint8_t* buffer, uint8_t* end, std::vector& programInfoMap, std::map& streamInfoMap) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, end); uint32_t length = reader.getBits(32); reader.skipBits(8); // reserved_for_word_align @@ -777,7 +777,7 @@ void CLPIParser::composeClipInfo(BitStreamWriter& writer) void CLPIParser::parseSequenceInfo(uint8_t* buffer, uint8_t* end) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, end); uint32_t length = reader.getBits(32); reader.skipBits(8); // reserved_for_word_align 8 bslbf @@ -823,7 +823,7 @@ void CLPIParser::composeSequenceInfo(BitStreamWriter& writer) void CLPIParser::parseCPI(uint8_t* buffer, uint8_t* end) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, end); uint32_t length = reader.getBits(32); if (length != 0) @@ -1019,7 +1019,7 @@ void CLPIParser::composeEP_map_for_one_stream_PID(BitStreamWriter& writer, M2TSS void CLPIParser::parseClipMark(uint8_t* buffer, uint8_t* end) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, end); uint32_t length = reader.getBits(32); } @@ -1057,7 +1057,7 @@ void CLPIParser::HDMV_LPCM_down_mix_coefficient(uint8_t* buffer, int dataLength) void CLPIParser::Extent_Start_Point(uint8_t* buffer, int dataLength) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, buffer + dataLength); uint32_t length = reader.getBits(32); @@ -1171,7 +1171,7 @@ void CLPIParser::composeExtentInfo(BitStreamWriter& writer) void CLPIParser::parseExtensionData(uint8_t* buffer, uint8_t* end) { // added for 3D compatibility - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, end); uint32_t length = reader.getBits(32); if (length == 0) @@ -1212,7 +1212,7 @@ void CLPIParser::parseExtensionData(uint8_t* buffer, uint8_t* end) void CLPIParser::parse(uint8_t* buffer, int len) { - BitStreamReader reader; + BitStreamReader reader{}; try { reader.setBuffer(buffer, buffer + len); @@ -1247,7 +1247,7 @@ void CLPIParser::parse(uint8_t* buffer, int len) int CLPIParser::compose(uint8_t* buffer, int bufferSize) { - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(buffer, buffer + bufferSize); CLPIStreamInfo::writeString("HDMV", writer, 4); CLPIStreamInfo::writeString(version_number, writer, 4); @@ -1348,7 +1348,7 @@ bool MPLSParser::parse(const char* fileName) void MPLSParser::parse(uint8_t* buffer, int len) { - BitStreamReader reader; + BitStreamReader reader{}; try { reader.setBuffer(buffer, buffer + len); @@ -1415,7 +1415,7 @@ void MPLSParser::SubPath_extension(BitStreamWriter& writer) int MPLSParser::composeSubPathEntryExtension(uint8_t* buffer, int bufferSize) { - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(buffer, buffer + bufferSize); try { @@ -1442,7 +1442,7 @@ int MPLSParser::composeSubPathEntryExtension(uint8_t* buffer, int bufferSize) int MPLSParser::composeSTN_tableSS(uint8_t* buffer, int bufferSize) { - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(buffer, buffer + bufferSize); try { @@ -1463,7 +1463,7 @@ int MPLSParser::composeSTN_tableSS(uint8_t* buffer, int bufferSize) int MPLSParser::composeUHD_metadata(uint8_t* buffer, int bufferSize) { - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(buffer, buffer + bufferSize); try { @@ -1500,7 +1500,7 @@ int MPLSParser::compose(uint8_t* buffer, int bufferSize, DiskType dt) } } - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(buffer, buffer + bufferSize); std::string type_indicator = "MPLS"; @@ -1628,7 +1628,7 @@ void MPLSParser::UO_mask_table(BitStreamReader& reader) void MPLSParser::parsePlayList(uint8_t* buffer, int len) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, buffer + len); uint32_t length = reader.getBits(32); reader.skipBits(16); // reserved_for_future_use 16 bslbf @@ -1819,7 +1819,7 @@ void MPLSParser::composeSubPlayItem(BitStreamWriter& writer, int playItemNum, in int MPLSParser::composePip_metadata(uint8_t* buffer, int bufferSize, std::vector& pmtIndexList) { // The ID1 value and the ID2 value of the ExtensionData() shall be set to 0x0001 and 0x0001 - BitStreamWriter writer; + BitStreamWriter writer{}; writer.setBuffer(buffer, buffer + bufferSize); uint32_t* lengthPos = (uint32_t*)buffer; writer.putBits(32, 0); // int length = reader.getBits(8); //8 uimsbf @@ -1930,7 +1930,7 @@ void MPLSParser::parseStnTableSS(uint8_t* data, int dataLength) { try { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(data, data + dataLength); int len = reader.getBits(16); bool fixedOffsetDuringPopup = reader.getBit(); @@ -1999,7 +1999,7 @@ void MPLSParser::parseStnTableSS(uint8_t* data, int dataLength) void MPLSParser::parseSubPathEntryExtension(uint8_t* data, int dataLen) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(data, data + dataLen); try { @@ -2056,7 +2056,7 @@ void MPLSParser::parseExtensionData(uint8_t* data, uint8_t* dataEnd) { try { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(data, dataEnd); uint32_t length = reader.getBits(32); if (length == 0) @@ -2225,7 +2225,7 @@ void MPLSParser::composePlayItem(BitStreamWriter& writer, int playItemNum, std:: void MPLSParser::parsePlayListMark(uint8_t* buffer, int len) { - BitStreamReader reader; + BitStreamReader reader{}; reader.setBuffer(buffer, buffer + len); uint32_t length = reader.getBits(32); // int number_of_PlayList_marks = reader.getBits(16); // 16 uimsbf diff --git a/tsMuxer/vvc.cpp b/tsMuxer/vvc.cpp index 7892b80..6a1faf6 100644 --- a/tsMuxer/vvc.cpp +++ b/tsMuxer/vvc.cpp @@ -64,7 +64,7 @@ int VvcUnit::deserialize() void VvcUnit::updateBits(int bitOffset, int bitLen, int value) { uint8_t* ptr = (uint8_t*)m_reader.getBuffer() + bitOffset / 8; - BitStreamWriter bitWriter; + BitStreamWriter bitWriter{}; int byteOffset = bitOffset % 8; bitWriter.setBuffer(ptr, ptr + (bitLen / 8 + 5));