Fix multi-plugin cascade when using non-seeking readers

CQTexperiment
Christopher Snowhill 2020-03-07 16:09:26 -08:00
parent 443aa05f88
commit 6d0166e69b
1 changed files with 14 additions and 1 deletions

View File

@ -85,7 +85,13 @@ NSArray * sortClassesByPriority(NSArray * theClasses)
for (NSDictionary *obsItem in cachedObservers) { for (NSDictionary *obsItem in cachedObservers) {
[theDecoder removeObserver:[obsItem objectForKey:@"observer"] forKeyPath:[obsItem objectForKey:@"keyPath"]]; [theDecoder removeObserver:[obsItem objectForKey:@"observer"] forKeyPath:[obsItem objectForKey:@"keyPath"]];
} }
[source seek:0 whence:SEEK_SET]; if (![source seekable]) {
NSURL * url = [source url];
[source close];
[source open:url];
}
else
[source seek:0 whence:SEEK_SET];
} }
theDecoder = nil; theDecoder = nil;
return NO; return NO;
@ -179,6 +185,13 @@ NSArray * sortClassesByPriority(NSArray * theClasses)
NSDictionary * data = [reader propertiesForSource:source]; NSDictionary * data = [reader propertiesForSource:source];
if ([data count]) if ([data count])
return data; return data;
if (![source seekable]) {
NSURL * url = [source url];
[source close];
[source open:url];
}
else
[source seek:0 whence:SEEK_SET];
} }
return nil; return nil;
} }