From 117ab533434f03f0ccb17166ff142a334dc945db Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 8 Mar 2020 20:04:10 -0700 Subject: [PATCH] Fix multi-plugin cascade to handle non-seeking readers, where disposing of some data while finding an input is okay --- Audio/CogPluginMulti.m | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Audio/CogPluginMulti.m b/Audio/CogPluginMulti.m index 24706617b..7efe2f63b 100644 --- a/Audio/CogPluginMulti.m +++ b/Audio/CogPluginMulti.m @@ -85,12 +85,7 @@ NSArray * sortClassesByPriority(NSArray * theClasses) for (NSDictionary *obsItem in cachedObservers) { [theDecoder removeObserver:[obsItem objectForKey:@"observer"] forKeyPath:[obsItem objectForKey:@"keyPath"]]; } - if (![source seekable]) { - NSURL * url = [source url]; - [source close]; - [source open:url]; - } - else + if ([source seekable]) [source seek:0 whence:SEEK_SET]; } theDecoder = nil; @@ -185,12 +180,7 @@ NSArray * sortClassesByPriority(NSArray * theClasses) NSDictionary * data = [reader propertiesForSource:source]; if ([data count]) return data; - if (![source seekable]) { - NSURL * url = [source url]; - [source close]; - [source open:url]; - } - else + if ([source seekable]) [source seek:0 whence:SEEK_SET]; } return nil;