Bug Fix: Attempt to solve a next track crash
This was attempting to retrieve the NSURL host object, possibly on a file URL where the two did not match a previous check. Now we only pass the full scheme/host/path check if both URLs are not file URLs. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
ba52c69a5a
commit
07a36873e3
1 changed files with 22 additions and 1 deletions
|
@ -410,9 +410,30 @@
|
|||
|
||||
if([unixPathNext isEqualToString:unixPathPrev])
|
||||
pathsEqual = YES;
|
||||
} else if(![nextStream isFileURL] && ![[lastChain streamURL] isFileURL]) {
|
||||
@try {
|
||||
NSURL *lastURL = [lastChain streamURL];
|
||||
NSString *nextScheme = [nextStream scheme];
|
||||
NSString *lastScheme = [lastURL scheme];
|
||||
NSString *nextHost = [nextStream host];
|
||||
NSString *lastHost = [lastURL host];
|
||||
NSString *nextPath = [nextStream path];
|
||||
NSString *lastPath = [lastURL path];
|
||||
if(nextScheme && lastScheme && [nextScheme isEqualToString:lastScheme]) {
|
||||
if((!nextHost && !lastHost) ||
|
||||
(nextHost && lastHost && [nextHost isEqualToString:lastHost])) {
|
||||
if(nextPath && lastPath && [nextPath isEqualToString:lastPath]) {
|
||||
pathsEqual = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@catch(id anException) {
|
||||
DLog(@"Exception thrown checking file match: %@", anException);
|
||||
}
|
||||
}
|
||||
|
||||
if(pathsEqual || ([[nextStream scheme] isEqualToString:[[lastChain streamURL] scheme]] && (([nextStream host] == nil && [[lastChain streamURL] host] == nil) || [[nextStream host] isEqualToString:[[lastChain streamURL] host]]) && [[nextStream path] isEqualToString:[[lastChain streamURL] path]])) {
|
||||
if(pathsEqual) {
|
||||
if([lastChain setTrack:nextStream] && [newChain openWithInput:[lastChain inputNode] withOutputFormat:[output format] withUserInfo:nextStreamUserInfo withRGInfo:nextStreamRGInfo]) {
|
||||
[newChain setStreamURL:nextStream];
|
||||
|
||||
|
|
Loading…
Reference in a new issue