diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-06-22 00:14:53 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-06-22 00:14:53 +0400 |
commit | cc71dcc218d9ee4612bfe955be6f00be521be5b1 (patch) | |
tree | 5f868efc11f940b72cdf0e0c5d19f27e7d3067c7 /intern/audaspace/sndfile | |
parent | 7ba4362c72c3ccd4763762414bd928682a51b7ce (diff) |
3D Audio GSoC:
Streaming improved.
Diffstat (limited to 'intern/audaspace/sndfile')
-rw-r--r-- | intern/audaspace/sndfile/AUD_SndFileReader.cpp | 6 | ||||
-rw-r--r-- | intern/audaspace/sndfile/AUD_SndFileReader.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.cpp b/intern/audaspace/sndfile/AUD_SndFileReader.cpp index cfe42b0725d..16c90b6f0f1 100644 --- a/intern/audaspace/sndfile/AUD_SndFileReader.cpp +++ b/intern/audaspace/sndfile/AUD_SndFileReader.cpp @@ -161,9 +161,13 @@ AUD_Specs AUD_SndFileReader::getSpecs() const return m_specs; } -void AUD_SndFileReader::read(int & length, sample_t* buffer) +void AUD_SndFileReader::read(int& length, bool& eos, sample_t* buffer) { + int olen = length; + length = sf_readf_float(m_sndfile, buffer, length); m_position += length; + + eos = length < olen; } diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.h b/intern/audaspace/sndfile/AUD_SndFileReader.h index 54ab05c63da..e7f9e9bf6d6 100644 --- a/intern/audaspace/sndfile/AUD_SndFileReader.h +++ b/intern/audaspace/sndfile/AUD_SndFileReader.h @@ -124,7 +124,7 @@ public: virtual int getLength() const; virtual int getPosition() const; virtual AUD_Specs getSpecs() const; - virtual void read(int & length, sample_t* buffer); + virtual void read(int& length, bool& eos, sample_t* buffer); }; #endif //AUD_SNDFILEREADER |