From 7ef8d11baeaf1847ba7f1df5d858f8cffea9300d Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Wed, 12 Aug 2020 21:03:34 +0000 Subject: coding style fixes git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9470 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/aac/aacfile.cpp | 11 ++--------- src/plugins/Input/aac/aacfile.h | 14 +++++++------- src/plugins/Input/aac/decoder_aac.cpp | 15 ++------------- src/plugins/Input/aac/decoder_aac.h | 21 +++++++++------------ 4 files changed, 20 insertions(+), 41 deletions(-) (limited to 'src/plugins/Input/aac') diff --git a/src/plugins/Input/aac/aacfile.cpp b/src/plugins/Input/aac/aacfile.cpp index cf60f8e57..66f5e10d3 100644 --- a/src/plugins/Input/aac/aacfile.cpp +++ b/src/plugins/Input/aac/aacfile.cpp @@ -30,14 +30,8 @@ static int adts_sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350,0,0,0}; -AACFile::AACFile(QIODevice *input, bool metaData, bool adts) +AACFile::AACFile(QIODevice *input, bool metaData, bool adts) : m_input(input) { - m_isValid = false; - m_duration = 0; - m_bitrate = 0; - m_samplerate = 0; - m_input = input; - m_offset = 0; char buf[AAC_BUFFER_SIZE]; qint64 buf_at = input->peek((char *) buf, AAC_BUFFER_SIZE); @@ -257,9 +251,8 @@ void AACFile::parseID3v2(const QByteArray &data) m_metaData.insert(Qmmp::TRACK, QString::number(taglib_tag.track())); } -ID3v2Tag::ID3v2Tag(const QByteArray &array) : TagLib::ID3v2::Tag() +ID3v2Tag::ID3v2Tag(const QByteArray &array) : TagLib::ID3v2::Tag(), m_buf(array) { - m_buf = array; read(); } diff --git a/src/plugins/Input/aac/aacfile.h b/src/plugins/Input/aac/aacfile.h index 61e34c2ea..762322249 100644 --- a/src/plugins/Input/aac/aacfile.h +++ b/src/plugins/Input/aac/aacfile.h @@ -42,7 +42,7 @@ class QBuffer; class AACFile { public: - AACFile(QIODevice *input, bool metaData = true, bool adts = true); + explicit AACFile(QIODevice *input, bool metaData = true, bool adts = true); ~AACFile(); @@ -56,19 +56,19 @@ public: private: void parseADTS(); void parseID3v2(const QByteArray &data); - qint64 m_duration; - quint32 m_bitrate; - int m_offset; + qint64 m_duration = 0; + quint32 m_bitrate = 0; + int m_offset = 0; QIODevice *m_input; - bool m_isValid; - quint32 m_samplerate; + bool m_isValid = false; + quint32 m_samplerate = 0; QMap m_metaData; }; class ID3v2Tag : public TagLib::ID3v2::Tag { public: - ID3v2Tag(const QByteArray &array); + explicit ID3v2Tag(const QByteArray &array); protected: void read(); diff --git a/src/plugins/Input/aac/decoder_aac.cpp b/src/plugins/Input/aac/decoder_aac.cpp index ec7b45696..f663a468a 100644 --- a/src/plugins/Input/aac/decoder_aac.cpp +++ b/src/plugins/Input/aac/decoder_aac.cpp @@ -30,19 +30,8 @@ // Decoder class -DecoderAAC::DecoderAAC(QIODevice *i) - : Decoder(i) -{ - m_bitrate = 0; - m_totalTime = 0; - m_data = nullptr; - m_input_buf = nullptr; - m_input_at = 0; - m_sample_buf = nullptr; - m_sample_buf_at = 0; - m_sample_buf_size = 0; -} - +DecoderAAC::DecoderAAC(QIODevice *i) : Decoder(i) +{} DecoderAAC::~DecoderAAC() { diff --git a/src/plugins/Input/aac/decoder_aac.h b/src/plugins/Input/aac/decoder_aac.h index 4f2c3590b..e8a2329b1 100644 --- a/src/plugins/Input/aac/decoder_aac.h +++ b/src/plugins/Input/aac/decoder_aac.h @@ -21,12 +21,9 @@ #ifndef DECODER_AAC_H #define DECODER_AAC_H - #include - #include - struct aac_data { NeAACDecHandle handle; @@ -35,7 +32,7 @@ struct aac_data class DecoderAAC : public Decoder { public: - DecoderAAC(QIODevice *); + explicit DecoderAAC(QIODevice *); virtual ~DecoderAAC(); @@ -51,14 +48,14 @@ public: void seek(qint64 time) override; private: - struct aac_data *m_data; - char* m_input_buf; - void* m_sample_buf; - int m_sample_buf_at; - qint64 m_sample_buf_size; - int m_bitrate; - ulong m_input_at; - qint64 m_totalTime; + struct aac_data *m_data = nullptr; + char *m_input_buf = nullptr; + void *m_sample_buf = nullptr; + int m_sample_buf_at = 0; + qint64 m_sample_buf_size = 0; + int m_bitrate = 0; + ulong m_input_at = 0; + qint64 m_totalTime = 0; }; -- cgit v1.2.3-13-gbd6f