diff options
Diffstat (limited to 'src/plugins/Input/flac')
| -rw-r--r-- | src/plugins/Input/flac/decoder_flac.cpp | 9 | ||||
| -rw-r--r-- | src/plugins/Input/flac/decoder_flac.h | 48 | ||||
| -rw-r--r-- | src/plugins/Input/flac/flacmetadatamodel.cpp | 6 | ||||
| -rw-r--r-- | src/plugins/Input/flac/flacmetadatamodel.h | 6 |
4 files changed, 28 insertions, 41 deletions
diff --git a/src/plugins/Input/flac/decoder_flac.cpp b/src/plugins/Input/flac/decoder_flac.cpp index f45b3148e..281d2053f 100644 --- a/src/plugins/Input/flac/decoder_flac.cpp +++ b/src/plugins/Input/flac/decoder_flac.cpp @@ -136,7 +136,6 @@ static FLAC__StreamDecoderReadStatus flac_callback_read (const FLAC__StreamDecod } return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - } static FLAC__StreamDecoderWriteStatus flac_callback_write (const FLAC__StreamDecoder *d, @@ -270,16 +269,8 @@ DecoderFLAC::DecoderFLAC(const QString &path, QIODevice *i) m_data = new flac_data; m_data->decoder = nullptr; m_data->input = i; - m_parser = nullptr; - length_in_bytes = 0; - m_totalBytes = 0; - m_sz = 0; - m_buf = nullptr; - m_offset = 0; - m_track = 0; } - DecoderFLAC::~DecoderFLAC() { deinit(); diff --git a/src/plugins/Input/flac/decoder_flac.h b/src/plugins/Input/flac/decoder_flac.h index 2d31f97a3..f24a2956a 100644 --- a/src/plugins/Input/flac/decoder_flac.h +++ b/src/plugins/Input/flac/decoder_flac.h @@ -34,28 +34,28 @@ class CueParser; struct flac_data { //FLAC__SeekableStreamDecoder *decoder; - FLAC__StreamDecoder *decoder; - int bitrate; - int abort; /* abort playing (due to an error) */ + FLAC__StreamDecoder *decoder = nullptr; + int bitrate = 0; + int abort = 0; /* abort playing (due to an error) */ - qint64 length; - qint64 total_samples; + qint64 length = 0; + qint64 total_samples = 0; FLAC__byte sample_buffer[SAMPLE_BUFFER_SIZE]; - unsigned sample_buffer_fill; + unsigned sample_buffer_fill = 0; /* sound parameters */ - unsigned bits_per_sample; - unsigned sample_rate; - unsigned channels; + unsigned bits_per_sample = 0; + unsigned sample_rate = 0; + unsigned channels = 0; - FLAC__uint64 last_decode_position; + FLAC__uint64 last_decode_position = 0; //counters - qint64 read_bytes; - qint64 frame_counter; + qint64 read_bytes = 0; + qint64 frame_counter = 0; - QIODevice *input; + QIODevice *input = nullptr; }; class DecoderFLAC : public Decoder @@ -80,17 +80,17 @@ private: uint findID3v2(char *data, ulong size); //retuns ID3v2 tag size ChannelMap findChannelMap(int channels); - struct flac_data *m_data; - qint64 length_in_bytes; - qint64 m_totalBytes; - qint64 m_offset; - qint64 m_length; - QString m_path; - CueParser *m_parser; - int m_track; - char *m_buf; //buffer for remainig data - qint64 m_buf_size; - qint64 m_sz; //sample size + struct flac_data *m_data = nullptr; + qint64 length_in_bytes = 0; + qint64 m_totalBytes = 0; + qint64 m_offset = 0; + qint64 m_length = 0; + QString m_path = 0; + CueParser *m_parser = nullptr; + int m_track = 0; + char *m_buf = nullptr; //buffer for remainig data + qint64 m_buf_size = 0; + qint64 m_sz = 0; //sample size }; diff --git a/src/plugins/Input/flac/flacmetadatamodel.cpp b/src/plugins/Input/flac/flacmetadatamodel.cpp index c4b2301b7..14e87f358 100644 --- a/src/plugins/Input/flac/flacmetadatamodel.cpp +++ b/src/plugins/Input/flac/flacmetadatamodel.cpp @@ -25,7 +25,7 @@ #include <taglib/tmap.h> #include <taglib/id3v2framefactory.h> #include <taglib/flacpicture.h> -#ifndef IS_COVER_EDITABLE +#ifndef HAS_PICTURE_LIST #include <FLAC/all.h> #endif #include <qmmp/metadatamanager.h> @@ -38,10 +38,6 @@ FLACMetaDataModel::FLACMetaDataModel(const QString &path, bool readOnly) : MetaDataModel(true) #endif { - m_file = nullptr; - m_stream = nullptr; - m_tag = nullptr; - if(path.startsWith("flac://")) { QString p = path; diff --git a/src/plugins/Input/flac/flacmetadatamodel.h b/src/plugins/Input/flac/flacmetadatamodel.h index 440c490db..55b4a5bc7 100644 --- a/src/plugins/Input/flac/flacmetadatamodel.h +++ b/src/plugins/Input/flac/flacmetadatamodel.h @@ -48,9 +48,9 @@ public: private: QString m_path; QList<TagModel* > m_tags; - TagLib::Ogg::XiphComment *m_tag; - TagLib::File *m_file; - TagLib::FileStream *m_stream; + TagLib::Ogg::XiphComment *m_tag = nullptr; + TagLib::File *m_file = nullptr; + TagLib::FileStream *m_stream = nullptr; }; class VorbisCommentModel : public TagModel |
