diff --git a/VoidLink/Stream/VideoDecoderRenderer.m b/VoidLink/Stream/VideoDecoderRenderer.m index aabc6145..cbc9fb51 100644 --- a/VoidLink/Stream/VideoDecoderRenderer.m +++ b/VoidLink/Stream/VideoDecoderRenderer.m @@ -441,21 +441,22 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit); [[NSNotificationCenter defaultCenter] removeObserver:self]; [_displayLink invalidate]; } -- (void)cleanup -{ - [_frameQueue stop]; - if (_renderingBackend == RENDER_AVSB) { - [_displayLink invalidate]; - } - - @synchronized(self) { - if (_decompressionSession != NULL) { - VTDecompressionSessionInvalidate(_decompressionSession); - CFRelease(_decompressionSession); - _decompressionSession = nil; +- (void)cleanup{ + dispatch_async(dispatch_get_main_queue(), ^{ + [self->_frameQueue stop]; + + if (self->_renderingBackend == RENDER_AVSB) { + [self->_displayLink invalidate]; } - } + @synchronized(self) { + if (self->_decompressionSession != NULL) { + VTDecompressionSessionInvalidate(self->_decompressionSession); + CFRelease(self->_decompressionSession); + self->_decompressionSession = nil; + } + } + }); } #define NALU_START_PREFIX_SIZE 3 diff --git a/VoidLink/ViewControllers/SettingsViewController.m b/VoidLink/ViewControllers/SettingsViewController.m index 09650580..a5ef4417 100644 --- a/VoidLink/ViewControllers/SettingsViewController.m +++ b/VoidLink/ViewControllers/SettingsViewController.m @@ -1689,7 +1689,7 @@ BOOL isCustomResolution(int resolutionSelected) { [_favoriteSettingStackIdentifiers removeAllObjects]; //for(NSInteger i = 0; i < parentStack.arrangedSubviews.count; i++){ for(NSInteger i = 0; i < _parentStack.arrangedSubviews.count; i++){ - [_favoriteSettingStackIdentifiers addObject:_parentStack.arrangedSubviews[i].accessibilityIdentifier]; + if(_parentStack.arrangedSubviews[i].accessibilityIdentifier) [_favoriteSettingStackIdentifiers addObject:_parentStack.arrangedSubviews[i].accessibilityIdentifier]; } } [[NSUserDefaults standardUserDefaults] setObject:_favoriteSettingStackIdentifiers forKey:@"FavoriteSettingStackIdentifiers"];