Merge pull request #519 from jcdr428/Fix_uninitialized

Fix "uninitialized member variable" compiler warnings
This commit is contained in:
jcdr428 2021-12-30 15:44:00 +01:00 committed by GitHub
commit fcd96b68a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 70 additions and 18 deletions

View File

@ -19,9 +19,13 @@ struct ReaderData
m_notified(false),
m_nextBlockSize(0),
m_deleted(false),
m_firstBlock(false),
m_lastBlock(false),
m_eof(false),
m_atQueue(0),
itr(0),
m_blockSize(0),
m_allocSize(0),
m_readOffset(0)
{
m_nextBlock[0] = NULL;

View File

@ -43,8 +43,11 @@ class AbstractStreamReader : public BaseAbstractStreamReader
m_containerType(ctNone),
m_demuxMode(false),
m_secondary(false),
m_curPos(0),
m_buffer(0),
m_bufEnd(0)
m_bufEnd(0),
m_streamIndex(0),
m_tmpBufferLen(0)
{
}
virtual ~AbstractStreamReader() {}

View File

@ -21,7 +21,7 @@ class AbstractReader
static const int DATA_DELAYED = 4;
static const int DATA_NOT_READY2 = 5;
AbstractReader() {}
AbstractReader() : m_blockSize(0), m_allocSize(0), m_prereadThreshold(0) {}
virtual ~AbstractReader() {}
virtual uint8_t* readBlock(uint32_t readerID, uint32_t& readCnt, int& rez, bool* firstBlockVar = 0) = 0;
virtual void notify(uint32_t readerID, uint32_t dataReaded) = 0;

View File

@ -30,7 +30,10 @@ class BaseAbstractStreamReader;
struct AVPacket
{
AVPacket() : pts(0), dts(0), data(0), size(0), stream_index(0), flags(0), duration(0), pos(0), pcr(0), codecID(0) {}
AVPacket()
: pts(0), dts(0), data(0), size(0), stream_index(0), flags(0), duration(0), pos(0), pcr(0), codecID(0), codec()
{
}
int64_t pts; // presentation time stamp in time_base units
int64_t dts; // decompression time stamp in time_base units
uint8_t* data;

View File

@ -20,7 +20,7 @@ struct WriterData
int m_command;
public:
WriterData() {}
WriterData() : m_buffer(0), m_bufferLen(0), m_mainFile(), m_command(0) {}
enum Commands
{
wdNone,

View File

@ -49,7 +49,10 @@ enum HEVCUnitType
struct HevcUnit
{
HevcUnit() : nal_unit_type(0), nuh_layer_id(0), nuh_temporal_id_plus1(0), m_nalBuffer(0), m_nalBufferLen(0) {}
HevcUnit()
: nal_unit_type(0), nuh_layer_id(0), nuh_temporal_id_plus1(0), m_nalBuffer(0), m_nalBufferLen(0), m_reader()
{
}
void decodeBuffer(const uint8_t* buffer, const uint8_t* end);
virtual int deserialize();

View File

@ -115,7 +115,7 @@ class ContainerToReaderWrapper : public AbstractReader
};
ContainerToReaderWrapper(const METADemuxer& owner, const BufferedReaderManager& readManager)
: m_owner(owner), m_readManager(readManager)
: m_owner(owner), m_readManager(readManager), m_readBuffOffset(0)
{
BufferedReaderManager& brm = const_cast<BufferedReaderManager&>(readManager);

View File

@ -83,8 +83,11 @@ class NALUnit
uint8_t* m_nalBuffer;
int m_nalBufferLen;
NALUnit(uint8_t nalUnitType) : nal_unit_type(nalUnitType), nal_ref_idc(0), m_nalBuffer(0), m_nalBufferLen(0) {}
NALUnit() : nal_unit_type(0), nal_ref_idc(0), m_nalBuffer(0), m_nalBufferLen(0) {}
NALUnit(uint8_t nalUnitType)
: nal_unit_type(nalUnitType), nal_ref_idc(0), m_nalBuffer(0), m_nalBufferLen(0), bitReader()
{
}
NALUnit() : nal_unit_type(0), nal_ref_idc(0), m_nalBuffer(0), m_nalBufferLen(0), bitReader() {}
// NALUnit(const NALUnit& other);
virtual ~NALUnit() { delete[] m_nalBuffer; }
static uint8_t* findNextNAL(uint8_t* buffer, uint8_t* end);
@ -131,7 +134,7 @@ class NALDelimiter : public NALUnit
const static int PCT_I_SI_P_SP_FRAMES = 6;
const static int PCT_I_SI_P_SP_B_FRAMES = 7;
int primary_pic_type;
NALDelimiter() : NALUnit(nuDelimiter) {}
NALDelimiter() : NALUnit(nuDelimiter), primary_pic_type(0) {}
int deserialize(uint8_t* buffer, uint8_t* end) override;
int serialize(uint8_t* dstBuffer) override;
};
@ -169,7 +172,15 @@ class PPSUnit : public NALUnit
int slice_group_map_type;
*/
PPSUnit() : NALUnit(), m_ready(false) {}
PPSUnit()
: NALUnit(),
m_ready(false),
entropy_coding_mode_flag(true),
pic_order_present_flag(true),
pic_parameter_set_id(0),
seq_parameter_set_id(0)
{
}
~PPSUnit() override {}
bool isReady() { return m_ready; }
int deserialize();
@ -319,7 +330,11 @@ class SEIUnit : public NALUnit
number_of_offset_sequences(-1),
metadataPtsOffset(0),
m_mvcHeaderLen(0),
m_mvcHeaderStart(0)
m_mvcHeaderStart(0),
cpb_removal_delay(0),
dpb_output_delay(0),
initial_cpb_removal_delay(),
initial_cpb_removal_delay_offset()
{
}
~SEIUnit() override {}

View File

@ -203,13 +203,17 @@ typedef std::map<uint64_t, PMTIndexData> PMTIndex;
struct PMTStreamInfo
{
PMTStreamInfo()
: m_streamType(0),
m_esInfoLen(0),
m_pid(0),
m_pmtPID(-1),
isSecondary(false),
m_codecReader(),
m_esInfoData(),
m_lang()
{
m_streamType = 0;
m_esInfoLen = 0;
m_pid = 0;
m_pmtPID = -1;
isSecondary = false;
}
PMTStreamInfo(int streamType, int pid, uint8_t* esInfoData, int esInfoLen, AbstractStreamReader* codecReader,
const std::string& lang, bool secondary)
{
@ -310,7 +314,13 @@ struct M2TSStreamInfo
HDR(0),
frame_rate_index(3),
video_format(0),
isSecondary(false)
isSecondary(false),
aspect_ratio_index(0),
audio_presentation_type(0),
language_code(),
number_of_offset_sequences(0),
sampling_frequency_index(0),
stream_coding_type(0)
{
}
M2TSStreamInfo(const PMTStreamInfo& pmtStreamInfo);
@ -394,7 +404,21 @@ struct CLPIProgramInfo
class CLPIParser
{
public:
CLPIParser() : isDependStream(false) {}
CLPIParser()
: isDependStream(false),
TS_recording_rate(0),
application_type(0),
clip_stream_type(0),
format_identifier(),
is_ATC_delta(false),
m_clpiNum(0),
number_of_source_packets(0),
presentation_start_time(0),
presentation_end_time(0),
type_indicator(),
version_number()
{
}
void parse(uint8_t* buffer, int len);
bool parse(const char* fileName);