diff --git a/Audio/AudioPlayer.m b/Audio/AudioPlayer.m index 4b5bfd638..91e9a22cb 100644 --- a/Audio/AudioPlayer.m +++ b/Audio/AudioPlayer.m @@ -77,7 +77,7 @@ bufferChain = [[BufferChain alloc] initWithController:self]; [self notifyStreamChanged:userInfo]; - while (![bufferChain open:url withOutputFormat:[output format]]) + while (![bufferChain open:url withOutputFormat:[output format] withRGInfo:rgi]) { [bufferChain release]; bufferChain = nil; @@ -99,7 +99,6 @@ } [bufferChain setUserInfo:userInfo]; - [bufferChain setRGInfo:rgi]; [self setShouldContinue:YES]; @@ -256,7 +255,7 @@ && [[nextStream path] isEqualToString:[[lastChain streamURL] path]]) { if ([lastChain setTrack:nextStream] - && [newChain openWithInput:[lastChain inputNode] withOutputFormat:[output format]]) + && [newChain openWithInput:[lastChain inputNode] withOutputFormat:[output format] withRGInfo:nextStreamRGInfo]) { [newChain setStreamURL:nextStream]; [newChain setUserInfo:nextStreamUserInfo]; @@ -270,7 +269,7 @@ } } - while (![newChain open:nextStream withOutputFormat:[output format]]) + while (![newChain open:nextStream withOutputFormat:[output format] withRGInfo:nextStreamRGInfo]) { if (nextStream == nil) { diff --git a/Audio/Chain/BufferChain.h b/Audio/Chain/BufferChain.h index ae3b46aaf..fbdea021a 100644 --- a/Audio/Chain/BufferChain.h +++ b/Audio/Chain/BufferChain.h @@ -28,10 +28,10 @@ - (id)initWithController:(id)c; - (void)buildChain; -- (BOOL)open:(NSURL *)url withOutputFormat:(AudioStreamBasicDescription)outputFormat; +- (BOOL)open:(NSURL *)url withOutputFormat:(AudioStreamBasicDescription)outputFormat withRGInfo:(NSDictionary*)rgi; //Used when changing tracks to reuse the same decoder -- (BOOL)openWithInput:(InputNode *)i withOutputFormat:(AudioStreamBasicDescription)outputFormat; +- (BOOL)openWithInput:(InputNode *)i withOutputFormat:(AudioStreamBasicDescription)outputFormat withRGInfo:(NSDictionary*)rgi; - (void)seek:(double)time; diff --git a/Audio/Chain/BufferChain.m b/Audio/Chain/BufferChain.m index 81ff38a5d..1cf6a64d1 100644 --- a/Audio/Chain/BufferChain.m +++ b/Audio/Chain/BufferChain.m @@ -41,7 +41,7 @@ finalNode = converterNode; } -- (BOOL)open:(NSURL *)url withOutputFormat:(AudioStreamBasicDescription)outputFormat +- (BOOL)open:(NSURL *)url withOutputFormat:(AudioStreamBasicDescription)outputFormat withRGInfo:(NSDictionary *)rgi { [self setStreamURL:url]; @@ -61,6 +61,8 @@ if (![converterNode setupWithInputFormat:propertiesToASBD([inputNode properties]) outputFormat:outputFormat]) return NO; + [self setRGInfo:rgi]; + // return NO; return YES;