Playback continues as expected when you moved a song that was at the end of the playlist.
parent
85630c836a
commit
384911beb6
|
@ -26,6 +26,7 @@
|
||||||
id delegate;
|
id delegate;
|
||||||
|
|
||||||
BOOL outputLaunched;
|
BOOL outputLaunched;
|
||||||
|
BOOL endOfInputReached;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)init;
|
- (id)init;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
output = NULL;
|
output = NULL;
|
||||||
bufferChain = NULL;
|
bufferChain = NULL;
|
||||||
outputLaunched = NO;
|
outputLaunched = NO;
|
||||||
|
endOfInputReached = NO;
|
||||||
|
|
||||||
chainQueue = [[NSMutableArray alloc] init];
|
chainQueue = [[NSMutableArray alloc] init];
|
||||||
}
|
}
|
||||||
|
@ -63,6 +64,7 @@
|
||||||
[anObject setShouldContinue:NO];
|
[anObject setShouldContinue:NO];
|
||||||
}
|
}
|
||||||
[chainQueue removeAllObjects];
|
[chainQueue removeAllObjects];
|
||||||
|
endOfInputReached = NO;
|
||||||
|
|
||||||
if (bufferChain)
|
if (bufferChain)
|
||||||
{
|
{
|
||||||
|
@ -168,10 +170,9 @@
|
||||||
- (void)resetNextStreams
|
- (void)resetNextStreams
|
||||||
{
|
{
|
||||||
@synchronized (chainQueue) {
|
@synchronized (chainQueue) {
|
||||||
NSUInteger count = [chainQueue count];
|
|
||||||
[chainQueue removeAllObjects];
|
[chainQueue removeAllObjects];
|
||||||
|
|
||||||
if (count) {
|
if (endOfInputReached) {
|
||||||
[self endOfInputReached:bufferChain];
|
[self endOfInputReached:bufferChain];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,6 +224,7 @@
|
||||||
|
|
||||||
- (BOOL)endOfInputReached:(BufferChain *)sender //Sender is a BufferChain
|
- (BOOL)endOfInputReached:(BufferChain *)sender //Sender is a BufferChain
|
||||||
{
|
{
|
||||||
|
@synchronized (chainQueue) {
|
||||||
BufferChain *newChain = nil;
|
BufferChain *newChain = nil;
|
||||||
|
|
||||||
nextStreamUserInfo = [sender userInfo];
|
nextStreamUserInfo = [sender userInfo];
|
||||||
|
@ -231,7 +233,8 @@
|
||||||
[self requestNextStream: nextStreamUserInfo];
|
[self requestNextStream: nextStreamUserInfo];
|
||||||
newChain = [[BufferChain alloc] initWithController:self];
|
newChain = [[BufferChain alloc] initWithController:self];
|
||||||
|
|
||||||
@synchronized (chainQueue) {
|
endOfInputReached = YES;
|
||||||
|
|
||||||
BufferChain *lastChain = [chainQueue lastObject];
|
BufferChain *lastChain = [chainQueue lastObject];
|
||||||
if (lastChain == nil) {
|
if (lastChain == nil) {
|
||||||
lastChain = bufferChain;
|
lastChain = bufferChain;
|
||||||
|
@ -270,8 +273,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
[self addChainToQueue:newChain];
|
[self addChainToQueue:newChain];
|
||||||
}
|
|
||||||
[newChain release];
|
[newChain release];
|
||||||
|
}
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
@ -281,6 +285,8 @@
|
||||||
@synchronized(chainQueue) {
|
@synchronized(chainQueue) {
|
||||||
if ([chainQueue count] <= 0)
|
if ([chainQueue count] <= 0)
|
||||||
{
|
{
|
||||||
|
endOfInputReached = NO;
|
||||||
|
|
||||||
//End of playlist
|
//End of playlist
|
||||||
[self stop];
|
[self stop];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue