[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 deviceChannelConfig;
|
||||||
uint32_t streamChannelConfig;
|
uint32_t streamChannelConfig;
|
||||||
|
uint32_t newChannelConfig;
|
||||||
|
|
||||||
AVSampleBufferAudioRenderer *audioRenderer;
|
AVSampleBufferAudioRenderer *audioRenderer;
|
||||||
AVSampleBufferRenderSynchronizer *renderSynchronizer;
|
AVSampleBufferRenderSynchronizer *renderSynchronizer;
|
||||||
|
|
|
@ -107,7 +107,7 @@ static OSStatus eqRenderCallback(void *inRefCon, AudioUnitRenderActionFlags *ioA
|
||||||
}
|
}
|
||||||
[currentPtsLock unlock];
|
[currentPtsLock unlock];
|
||||||
newFormat = format;
|
newFormat = format;
|
||||||
streamChannelConfig = config;
|
newChannelConfig = config;
|
||||||
streamFormatStarted = YES;
|
streamFormatStarted = YES;
|
||||||
|
|
||||||
visFormat = format;
|
visFormat = format;
|
||||||
|
@ -118,6 +118,7 @@ static OSStatus eqRenderCallback(void *inRefCon, AudioUnitRenderActionFlags *ioA
|
||||||
downmixerForVis = [[DownmixProcessor alloc] initWithInputFormat:format inputConfig:config andOutputFormat:visFormat outputConfig:AudioConfigMono];
|
downmixerForVis = [[DownmixProcessor alloc] initWithInputFormat:format inputConfig:config andOutputFormat:visFormat outputConfig:AudioConfigMono];
|
||||||
if(!r8bold) {
|
if(!r8bold) {
|
||||||
streamFormat = format;
|
streamFormat = format;
|
||||||
|
streamChannelConfig = config;
|
||||||
[self updateStreamFormat];
|
[self updateStreamFormat];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -714,6 +715,7 @@ current_device_listener(AudioObjectID inObjectID, UInt32 inNumberAddresses, cons
|
||||||
if(r8bDone) {
|
if(r8bDone) {
|
||||||
r8bDone = NO;
|
r8bDone = NO;
|
||||||
streamFormat = newFormat;
|
streamFormat = newFormat;
|
||||||
|
streamChannelConfig = newChannelConfig;
|
||||||
[self updateStreamFormat];
|
[self updateStreamFormat];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue