mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-01 17:58:29 +00:00
FIXED: small bug in mp3 decoder.
This commit is contained in:
parent
274809a4ca
commit
1ccfa6ac31
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user