FIXED: small bug in mp3 decoder.

This commit is contained in:
Daniel Önnerby 2009-01-05 00:14:00 +00:00
parent 274809a4ca
commit 1ccfa6ac31

View File

@ -216,8 +216,10 @@ bool MP3Decoder::Open(musik::core::filestreams::IFileStream *fileStream){
bool continueFeed(true);
// Loop until we have a format
int maxLoops(256); //
while(continueFeed){
continueFeed = continueFeed && this->Feed();
continueFeed = continueFeed && this->Feed() && maxLoops>0;
--maxLoops;
if(continueFeed){
if(mpg123_getformat(this->decoder,&this->cachedRate,&this->cachedChannels,&encoding)==MPG123_OK){
continueFeed = (this->cachedRate==0);
@ -225,6 +227,10 @@ bool MP3Decoder::Open(musik::core::filestreams::IFileStream *fileStream){
}
}
if(this->cachedRate==0){
return false;
}
this->sampleSize = this->cachedChannels*sizeof(float);
// Loop until we have a length