Can anyone explain why I would be getting this warning ?
[Internal] Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions.
The code (NB: This method is called on the main thread)
- (void)parseAudioTracks:(NSArray<AVAssetTrack *> *)audioTracks
{
NSMutableArray<AVAudioMixInputParameters *> *inputParameters = [NSMutableArray arrayWithCapacity:audioTracks.count];
NSMutableArray *tracksNames = [NSMutableArray array];
NSMutableArray *tracksChannels = [NSMutableArray array];
NSUInteger lastChannel = 0;
for ( NSUInteger i = 0 ; i < audioTracks.count; i++ )
{
AVAssetTrack *track = audioTracks[i];
for ( AVMetadataItem *item in track.metadata ) <-- WARNING HERE
...```
Hello,
Check out the discussion of thread priority inversions in Diagnosing performance issues early.
Could it be that there is audio processing occurring on the main thread that is waiting on the results of a lower priority thread? This would cause such a warning.