[Audio Output] Correctly delay layout updates
Channel layout updates should be delayed when resampling, just like sample format changes are. Signed-off-by: Christopher Snowhill <kode54@gmail.com>swiftingly
parent
8e1175bbd4
commit
b55955ef1c
|
@ -79,6 +79,7 @@ using std::atomic_long;
|
|||
|
||||
uint32_t deviceChannelConfig;
|
||||
uint32_t streamChannelConfig;
|
||||
uint32_t newChannelConfig;
|
||||
|
||||
AVSampleBufferAudioRenderer *audioRenderer;
|
||||
AVSampleBufferRenderSynchronizer *renderSynchronizer;
|
||||
|
|
|
@ -107,7 +107,7 @@ static OSStatus eqRenderCallback(void *inRefCon, AudioUnitRenderActionFlags *ioA
|
|||
}
|
||||
[currentPtsLock unlock];
|
||||
newFormat = format;
|
||||
streamChannelConfig = config;
|
||||
newChannelConfig = config;
|
||||
streamFormatStarted = YES;
|
||||
|
||||
visFormat = format;
|
||||
|
@ -118,6 +118,7 @@ static OSStatus eqRenderCallback(void *inRefCon, AudioUnitRenderActionFlags *ioA
|
|||
downmixerForVis = [[DownmixProcessor alloc] initWithInputFormat:format inputConfig:config andOutputFormat:visFormat outputConfig:AudioConfigMono];
|
||||
if(!r8bold) {
|
||||
streamFormat = format;
|
||||
streamChannelConfig = config;
|
||||
[self updateStreamFormat];
|
||||
}
|
||||
}
|
||||
|
@ -714,6 +715,7 @@ current_device_listener(AudioObjectID inObjectID, UInt32 inNumberAddresses, cons
|
|||
if(r8bDone) {
|
||||
r8bDone = NO;
|
||||
streamFormat = newFormat;
|
||||
streamChannelConfig = newChannelConfig;
|
||||
[self updateStreamFormat];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue