Error handler: Better handle errors and increase silence generator to 10 seconds at a time
parent
7da3324e32
commit
9566a36815
|
@ -51,10 +51,10 @@
|
|||
|
||||
id<CogSource> source = [AudioSource audioSourceForURL:url];
|
||||
DLog(@"Opening: %@", url);
|
||||
if (![source open:url])
|
||||
if (!source || ![source open:url])
|
||||
{
|
||||
DLog(@"Couldn't open source...");
|
||||
url = [NSURL URLWithString:@"silence://1"];
|
||||
url = [NSURL URLWithString:@"silence://10"];
|
||||
source = [AudioSource audioSourceForURL:url];
|
||||
if (![source open:url])
|
||||
return NO;
|
||||
|
|
|
@ -23,7 +23,10 @@ enum { channels = 2 };
|
|||
|
||||
NSString * path = [[[s url] relativeString] substringFromIndex:10];
|
||||
|
||||
length = [path intValue] * sample_rate;
|
||||
int seconds = [path intValue];
|
||||
if (!seconds) seconds = 10;
|
||||
|
||||
length = seconds * sample_rate;
|
||||
remain = length;
|
||||
|
||||
[self willChangeValueForKey:@"properties"];
|
||||
|
|
Loading…
Reference in New Issue