Minor changes that may or may not have any impact on gaplessness
parent
b9ce8462c4
commit
8c80981827
|
@ -134,9 +134,15 @@
|
|||
if (amountInBuffer < CHUNK_SIZE) {
|
||||
int framesToRead = (CHUNK_SIZE - amountInBuffer)/bytesPerFrame;
|
||||
int framesRead = [decoder readAudio:((char *)inputBuffer) + amountInBuffer frames:framesToRead];
|
||||
amountInBuffer += (framesRead * bytesPerFrame);
|
||||
|
||||
if (framesRead <= 0)
|
||||
if (framesRead > 0)
|
||||
{
|
||||
amountInBuffer += (framesRead * bytesPerFrame);
|
||||
[self writeData:inputBuffer amount:amountInBuffer];
|
||||
amountInBuffer = 0;
|
||||
}
|
||||
|
||||
if (framesRead < framesToRead)
|
||||
{
|
||||
if (initialBufferFilled == NO) {
|
||||
[controller initialBufferFilled:self];
|
||||
|
@ -163,10 +169,7 @@
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
[self writeData:inputBuffer amount:amountInBuffer];
|
||||
amountInBuffer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldClose)
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
[readLock lock];
|
||||
availInput = [[previousNode buffer] lengthAvailableToReadReturningPointer:&readPtr];
|
||||
|
||||
if (availInput <= amount && [previousNode endOfStream] == YES)
|
||||
if (availInput < amount && [previousNode endOfStream] == YES)
|
||||
{
|
||||
// [previousNode release];
|
||||
//If it is the outputNode, [soundController newInputChain];
|
||||
|
|
|
@ -54,6 +54,8 @@
|
|||
[self setPreviousNode:[[controller bufferChain] finalNode]];
|
||||
|
||||
n = [super readData:ptr amount:amount];
|
||||
amountPlayed += n;
|
||||
|
||||
if (endOfStream == YES)
|
||||
{
|
||||
amountPlayed = 0;
|
||||
|
@ -64,8 +66,6 @@
|
|||
DLog(@"Output Buffer dry!");
|
||||
}
|
||||
*/
|
||||
amountPlayed += n;
|
||||
|
||||
[pool release];
|
||||
|
||||
return n;
|
||||
|
|
Loading…
Reference in New Issue