- fixed uninitialized variables in decoders.

This commit is contained in:
Christoph Oelckers 2020-02-08 10:25:08 +01:00
parent dc214dbdd6
commit 7f63ad8707
2 changed files with 5 additions and 7 deletions

View file

@ -25,17 +25,16 @@ struct MPG123Decoder : public SoundDecoder
virtual size_t getSampleOffset() override; virtual size_t getSampleOffset() override;
virtual size_t getSampleLength() override; virtual size_t getSampleLength() override;
MPG123Decoder() : MPG123(0) { }
virtual ~MPG123Decoder(); virtual ~MPG123Decoder();
protected: protected:
virtual bool open(MusicIO::FileInterface *reader) override; virtual bool open(MusicIO::FileInterface *reader) override;
private: private:
mpg123_handle *MPG123; mpg123_handle *MPG123 = nullptr;
bool Done; bool Done = false;
MusicIO::FileInterface* Reader = nullptr;
MusicIO::FileInterface* Reader;
static off_t file_lseek(void *handle, off_t offset, int whence); static off_t file_lseek(void *handle, off_t offset, int whence);
static ssize_t file_read(void *handle, void *buffer, size_t bytes); static ssize_t file_read(void *handle, void *buffer, size_t bytes);

View file

@ -21,17 +21,16 @@ struct SndFileDecoder : public SoundDecoder
virtual size_t getSampleOffset() override; virtual size_t getSampleOffset() override;
virtual size_t getSampleLength() override; virtual size_t getSampleLength() override;
SndFileDecoder() : SndFile(0) { }
virtual ~SndFileDecoder(); virtual ~SndFileDecoder();
protected: protected:
virtual bool open(MusicIO::FileInterface *reader) override; virtual bool open(MusicIO::FileInterface *reader) override;
private: private:
SNDFILE *SndFile; SNDFILE *SndFile = nullptr;
SF_INFO SndInfo; SF_INFO SndInfo;
MusicIO::FileInterface* Reader = nullptr;
MusicIO::FileInterface* Reader;
static sf_count_t file_get_filelen(void *user_data); static sf_count_t file_get_filelen(void *user_data);
static sf_count_t file_seek(sf_count_t offset, int whence, void *user_data); static sf_count_t file_seek(sf_count_t offset, int whence, void *user_data);
static sf_count_t file_read(void *ptr, sf_count_t count, void *user_data); static sf_count_t file_read(void *ptr, sf_count_t count, void *user_data);