Skip to content

Commit

Permalink
remove redundant boolean filled
Browse files Browse the repository at this point in the history
  • Loading branch information
h3ndrik committed Aug 27, 2018
1 parent 135e912 commit be2ad3d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions src/AudioFileSourceBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ AudioFileSourceBuffer::AudioFileSourceBuffer(AudioFileSource *source, uint32_t b
readPtr = 0;
src = source;
length = 0;
filled = false;
}

AudioFileSourceBuffer::AudioFileSourceBuffer(AudioFileSource *source, void *inBuff, uint32_t buffSizeBytes)
Expand All @@ -45,7 +44,6 @@ AudioFileSourceBuffer::AudioFileSourceBuffer(AudioFileSource *source, void *inBu
readPtr = 0;
src = source;
length = 0;
filled = false;
}

AudioFileSourceBuffer::~AudioFileSourceBuffer()
Expand Down Expand Up @@ -95,12 +93,11 @@ uint32_t AudioFileSourceBuffer::read(void *data, uint32_t len)
if (!buffer) return src->read(data, len);

uint32_t bytes = 0;
if (!filled) {
if (length == 0) {
// Fill up completely before returning any data at all
cb.st(STATUS_FILLING, PSTR("Refilling buffer"));
length = src->read(buffer, buffSize);
writePtr = length % buffSize;
filled = true;
}

// Pull from buffer until we've got none left or we've satisfied the request
Expand Down Expand Up @@ -133,7 +130,6 @@ uint32_t AudioFileSourceBuffer::read(void *data, uint32_t len)
readPtr = 0;
writePtr = 0;
length = 0;
filled = false;
cb.st(STATUS_UNDERFLOW, PSTR("Buffer underflow"));
}

Expand Down
1 change: 0 additions & 1 deletion src/AudioFileSourceBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class AudioFileSourceBuffer : public AudioFileSource
uint32_t writePtr;
uint32_t readPtr;
uint32_t length;
bool filled;
};


Expand Down

0 comments on commit be2ad3d

Please sign in to comment.