Fix initialization in the same order as declaration

Plus remove few unused variables.
master
jcdr428 2022-01-22 22:32:51 +01:00
parent eb0694107b
commit 122ac882d2
7 changed files with 45 additions and 57 deletions

View File

@ -11,16 +11,16 @@ class AACCodec
static const int aac_sample_rates[16];
static const int aac_channels[8];
AACCodec()
: m_sample_rate(48000),
m_channels(0),
m_bit_rate(0),
m_channels_index(0),
m_id(0),
: m_id(0),
m_layer(0),
m_profile(0),
m_rdb(0),
m_channels(0),
m_sample_rate(48000),
m_samples(0),
m_bit_rate(0),
m_sample_rates_index(0),
m_samples(0)
m_channels_index(0),
m_profile(0),
m_rdb(0)
{
}
uint8_t* findAacFrame(uint8_t* buffer, uint8_t* end);
@ -40,7 +40,6 @@ class AACCodec
int m_sample_rates_index;
int m_channels_index;
int m_profile;
// int m_frameSize
int m_rdb; // ch, sr;
};

View File

@ -23,13 +23,13 @@ class DTSStreamReader : public SimplePacketizerReader
DTSStreamReader()
: SimplePacketizerReader(),
hd_pi_bit_rate_index(0),
hd_sample_rate(0),
i_frame_size(0),
nblks(0),
i_frame_size(0),
pi_audio_mode(0),
pi_bit_rate_index(0),
pi_channels_conf(0)
hd_pi_bit_rate_index(0),
pi_channels_conf(0),
hd_sample_rate(0)
{
pi_sample_rate_index = 0;
pi_bit_rate = 0;

View File

@ -10,12 +10,12 @@ class DVBSubStreamReader : public SimplePacketizerReader
public:
DVBSubStreamReader()
: SimplePacketizerReader(),
m_big_offsets(0),
m_frameDuration(0),
m_firstFrame(true),
m_end_display_time(0),
m_big_offsets(0),
m_offset_size(0),
m_start_display_time(0)
m_start_display_time(0),
m_end_display_time(0),
m_frameDuration(0)
{
}
int getTSDescriptor(uint8_t* dstBuff, bool blurayMode, bool hdmvDescriptors) override;

View File

@ -1344,7 +1344,6 @@ uint8_t* ContainerToReaderWrapper::readBlock(uint32_t readerID, uint32_t& readCn
}
else if (demuxerData.lastReadRez[pid] != AbstractReader::DATA_DELAYED || demuxerData.m_allFragmented)
{
map<uint32_t, uint32_t> dataTypeMap;
int demuxRez = 0;
do
{

View File

@ -24,14 +24,13 @@ double pgs_frame_rates[16] = {
PGSStreamReader::PGSStreamReader()
: m_avFragmentEnd(0),
m_firstRenderedPacket(true),
m_objectWindowHeight(0),
m_objectWindowTop(0),
m_paletteVersion(0),
m_palleteID(0),
m_ptsStart(0),
object_width(0),
object_height(0),
object_width(0)
m_firstRenderedPacket(true),
m_palleteID(0),
m_paletteVersion(0),
m_objectWindowHeight(0),
m_objectWindowTop(0)
{
m_curPos = m_buffer = 0;
m_tmpBufferLen = 0;
@ -210,8 +209,7 @@ const static int Y_THRESHOLD = 33;
int PGSStreamReader::readObjectDef(uint8_t* pos, uint8_t* end)
{
pos += 3; // skip object ID and version number
int seq = *pos++;
pos += 4; // skip object ID and version number
uint32_t objectSize = AV_RB24(pos);
pos += 3;
uint8_t* objEnd = pos + objectSize;
@ -237,8 +235,7 @@ int PGSStreamReader::readObjectDef(uint8_t* pos, uint8_t* end)
end = pos + AV_RB16(pos);
pos += 2;
object_id = AV_RB16(pos);
pos += 3; // skip object ID and version number
seq = *pos++;
pos += 4; // skip object ID and version number
}
size_t oldSize = m_dstRle.size();
m_dstRle.resize(oldSize + end - pos);
@ -374,11 +371,7 @@ void PGSStreamReader::renderTextShow(int64_t inTime)
void PGSStreamReader::renderTextHide(int64_t outTime)
{
double decodedObjectSize = m_render->renderedHeight() * m_scaled_width;
int64_t compositionDecodeTime = (int64_t)(90000.0 * decodedObjectSize / PIXEL_DECODING_RATE + 0.999);
int64_t windowsTransferTime = (int64_t)(90000.0 * decodedObjectSize / PIXEL_COMPOSITION_RATE + 0.999);
const int64_t PLANEINITIALIZATIONTIME =
(int64_t)(90000.0 * (m_scaled_width * m_scaled_height) / PIXEL_COMPOSITION_RATE + 0.999);
const int64_t PRESENTATION_DTS_DELTA = PLANEINITIALIZATIONTIME + windowsTransferTime;
m_firstRenderedPacket = true;
outTime = (int64_t)(outTime / INT_FREQ_TO_TS_FREQ);
@ -462,7 +455,7 @@ int PGSStreamReader::readPacket(AVPacket& avPacket)
int tmpWidth;
int tmpHeight;
m_render->enlargeCrop(m_video_width, m_video_height, &tmpWidth, &tmpHeight);
m_needRescale = m_scaled_width && m_scaled_width != tmpWidth || m_scaled_height && m_scaled_height != tmpHeight;
m_needRescale = (m_scaled_width && m_scaled_width != tmpWidth) || (m_scaled_height && m_scaled_height != tmpHeight);
// m_needRescale |= true;
if (m_needRescale)
{
@ -612,7 +605,7 @@ int PGSStreamReader::readPacket(AVPacket& avPacket)
BitStreamReader bitReader{};
try
{
int number_of_composition_objects, palette_update_flag, palette_id_ref, number_of_windows;
int number_of_composition_objects, number_of_windows;
switch (segment_type)
{
case PALETTE_DEF_SEGMENT:
@ -649,9 +642,7 @@ int PGSStreamReader::readPacket(AVPacket& avPacket)
video_descriptor(bitReader);
composition_descriptor(bitReader);
palette_update_flag = bitReader.getBit();
bitReader.skipBits(7);
palette_id_ref = bitReader.getBits(8);
bitReader.skipBits(16); // palette_update_flag, palette_id_ref
number_of_composition_objects = bitReader.getBits(8);
for (int i = 0; i < number_of_composition_objects; i++)
{

View File

@ -117,7 +117,6 @@ class PGSStreamReader : public AbstractStreamReader
std::map<uint8_t, text_subtitles::YUVQuad> m_palette;
int m_scaled_width;
int m_scaled_height;
int64_t m_ptsStart;
bool m_firstRenderedPacket;
text_subtitles::TextToPGSConverter* m_render;

View File

@ -62,7 +62,7 @@ extern const char* pict_type_str[4];
class VC1Unit
{
public:
VC1Unit() : m_nalBuffer(0), m_nalBufferLen(0), bitReader() {}
VC1Unit() : bitReader(), m_nalBuffer(0), m_nalBufferLen(0) {}
~VC1Unit() { delete[] m_nalBuffer; }
inline static bool isMarker(uint8_t* ptr) { return ptr[0] == ptr[1] == 0 && ptr[2] == 1; }
@ -154,24 +154,24 @@ class VC1SequenceHeader : public VC1Unit
VC1SequenceHeader()
: VC1Unit(),
profile(Profile::SIMPLE),
level(0),
interlace(0),
time_base_num(0),
time_base_den(0),
m_fpsFieldBitVal(0),
sample_aspect_ratio(1, 1),
coded_height(0),
coded_width(0),
display_height(0),
display_width(0),
finterpflag(false),
hrd_param_flag(false),
hrd_num_leaky_buckets(0),
psf(0),
pulldown(0),
rangered(0),
max_b_frames(0),
tfcntrflag(false)
finterpflag(false),
level(0),
coded_width(0),
coded_height(0),
display_width(0),
display_height(0),
pulldown(0),
interlace(0),
tfcntrflag(false),
psf(0),
time_base_num(0),
time_base_den(0),
hrd_param_flag(false),
hrd_num_leaky_buckets(0),
sample_aspect_ratio(1, 1),
m_fpsFieldBitVal(0)
{
}
Profile profile;
@ -210,7 +210,7 @@ class VC1SequenceHeader : public VC1Unit
class VC1Frame : public VC1Unit
{
public:
VC1Frame() : VC1Unit(), rptfrm(0), fcm(0), rff(0), tff(0), rptfrmBitPos(0), pict_type(VC1PictType::I_TYPE) {}
VC1Frame() : VC1Unit(), fcm(0), pict_type(VC1PictType::I_TYPE), rptfrm(0), tff(0), rff(0), rptfrmBitPos(0) {}
int fcm;
VC1PictType pict_type;
int rptfrm;