[Playback] Prevent erroneous file from repeating

Prevent Repeat Single from locking up the player on an unplayable file.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
xcode15
Christopher Snowhill 2022-07-06 02:20:05 -07:00
parent 8f4fb4a44c
commit adc159eb05
1 changed files with 15 additions and 1 deletions

View File

@ -90,6 +90,10 @@
[self requestNextStream:userInfo];
if([nextStream isEqualTo:url]) {
return;
}
url = nextStream;
if(url == nil) {
return;
@ -398,7 +402,9 @@
lastChain = nil;
while(shouldContinue && ![newChain open:nextStream withUserInfo:nextStreamUserInfo withRGInfo:nextStreamRGInfo]) {
NSURL *url = nextStream;
while(shouldContinue && ![newChain open:url withUserInfo:nextStreamUserInfo withRGInfo:nextStreamRGInfo]) {
if(nextStream == nil) {
newChain = nil;
atomic_fetch_sub(&refCount, 1);
@ -408,6 +414,14 @@
newChain = nil;
[self requestNextStream:nextStreamUserInfo];
if([nextStream isEqualTo:url]) {
newChain = nil;
atomic_fetch_sub(&refCount, 1);
return YES;
}
url = nextStream;
newChain = [[BufferChain alloc] initWithController:self];
}