mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-17 17:16:40 +08:00
mac-virtualcam: Always replace camera extension when requested
Current code assumes that a newer version of the extension is always better. However that's not true - when the user installs an old version of OBS, we should also install the old version of the camera extension to have a version compatible with the installed OBS. For normal users this method is only called when the versions in the Info.plist do not match. In system extensions developer mode it's called every time an installation is requested (meaning on every start), which is probably desired as well; and by never returning "ReplacementActionCancel" we can now always treat "ErrorRequestCanceled" as an error and not something that we requested to happen.
This commit is contained in:
@@ -68,15 +68,7 @@ struct virtualcam_data {
|
||||
actionForReplacingExtension:(nonnull OSSystemExtensionProperties *)existing
|
||||
withExtension:(nonnull OSSystemExtensionProperties *)ext
|
||||
{
|
||||
NSString *extVersion = [NSString stringWithFormat:@"%@.%@", [ext bundleShortVersion], [ext bundleVersion]];
|
||||
NSString *existingVersion =
|
||||
[NSString stringWithFormat:@"%@.%@", [existing bundleShortVersion], [existing bundleVersion]];
|
||||
|
||||
if ([extVersion compare:existingVersion options:NSNumericSearch] == NSOrderedDescending) {
|
||||
return OSSystemExtensionReplacementActionReplace;
|
||||
} else {
|
||||
return OSSystemExtensionReplacementActionCancel;
|
||||
}
|
||||
return OSSystemExtensionReplacementActionReplace;
|
||||
}
|
||||
|
||||
- (void)request:(nonnull OSSystemExtensionRequest *)request didFailWithError:(nonnull NSError *)error
|
||||
|
||||
Reference in New Issue
Block a user