Allow playing wav files via HTTPStream (#224)
* ReadWAVInfo(): print error message if seek() fails * AudioFileSourceHTTPStream::seek() print error message - not implemented * AudioFileSourceBuffer::seek if SEEK_CUR and seek_len < writePtr keep the buffer (fix for HTTPStream) * Update AudioFileSourceBuffer.cpp
This commit is contained in:
1 parent
16bd2a7b06
commit
074dfd47b0
3 files changed
+16
-7
No files matched your search
@@ -56,11 +56,16 @@ AudioFileSourceBuffer::~AudioFileSourceBuffer()
|
||||
|
||||
bool AudioFileSourceBuffer::seek(int32_t pos, int dir)
|
||||
{
|
||||
// Invalidate
|
||||
readPtr = 0;
|
||||
writePtr = 0;
|
||||
length = 0;
|
||||
return src->seek(pos, dir);
|
||||
if(dir == SEEK_CUR && (readPtr+pos) < length) {
|
||||
readPtr += pos;
|
||||
return true;
|
||||
} else {
|
||||
// Invalidate
|
||||
readPtr = 0;
|
||||
writePtr = 0;
|
||||
length = 0;
|
||||
return src->seek(pos, dir);
|
||||
}
|
||||
}
|
||||
|
||||
bool AudioFileSourceBuffer::close()
|
||||
|
||||
Reference in new issue
Block a user