Fix seeking in FLAC implementation (FLAC's API uses the number of sample pairs, not the number of samples).

svn-id: r47593
This commit is contained in:
Johannes Schickel 2010-01-27 08:41:08 +00:00
parent 8606982590
commit 7e1051d8ec

View File

@ -294,7 +294,9 @@ bool FlacInputStream::seekAbsolute(FLAC__uint64 sample) {
bool FlacInputStream::seek(const Timestamp &where) {
_sampleCache.bufFill = 0;
_sampleCache.bufReadPos = NULL;
return seekAbsolute((FLAC__uint64)convertTimeToStreamPos(where, getRate(), isStereo()).totalNumberOfFrames());
// FLAC uses the sample pair number, thus we always use "false" for the isStereo parameter
// of the convertTimeToStreamPos helper.
return seekAbsolute((FLAC__uint64)convertTimeToStreamPos(where, getRate(), false).totalNumberOfFrames());
}
int FlacInputStream::readBuffer(int16 *buffer, const int numSamples) {