{"record":{"id":"db1ce8e0a89e6a7b","repo":"SubtitleEdit/subtitleedit","slug":"unsupported-macos-architecture-db1ce8","errorCode":null,"errorMessage":"Unsupported macOS architecture.","messagePattern":"Unsupported macOS architecture\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"critical","filePath":"src/ui/Logic/Download/FfmpegDownloadService.cs","lineNumber":44,"sourceCode":"    }\n\n    private static string GetFfmpegUrl()\n    {\n        if (OperatingSystem.IsWindows())\n        {\n            return WindowsUrl;\n        }\n\n        if (OperatingSystem.IsMacOS())\n        {\n            switch (RuntimeInformation.ProcessArchitecture)\n            {\n                case Architecture.Arm64:\n                    return MacUrlArm; // e.g., for M1, M2, M3, M4 chips\n                case Architecture.X64:\n                    return MacUrl;\n                default:\n                    throw new PlatformNotSupportedException(\"Unsupported macOS architecture.\");\n            }\n        }\n\n        throw new PlatformNotSupportedException();\n    }\n\n    public async Task DownloadFfmpeg(string destinationFileName, IProgress<float>? progress, CancellationToken cancellationToken)\n    {\n        await DownloadHelper.DownloadFileAsync(_httpClient, GetFfmpegUrl(), destinationFileName, progress, cancellationToken);\n    }\n\n    public async Task DownloadFfmpeg(Stream stream, IProgress<float>? progress, CancellationToken cancellationToken)\n    {\n        await DownloadHelper.DownloadFileAsync(_httpClient, GetFfmpegUrl(), stream, progress, cancellationToken);\n    }\n}","sourceCodeStart":26,"sourceCodeEnd":60,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/FfmpegDownloadService.cs#L26-L60","documentation":"Thrown by FfmpegDownloadService.GetUrl() in the default case of the macOS architecture switch. The switch handles Arm64 (MacUrlArm) and X64 (MacUrl) but any other Architecture value on macOS falls through. PlatformNotSupportedException indicates no FFmpeg build URL exists for that combination.","triggerScenarios":"OperatingSystem.IsMacOS() is true but ProcessArchitecture is neither Arm64 nor X64 — e.g. a future Architecture enum value, or a misreported architecture under a translation layer. In practice rare, since Apple hardware is either Apple Silicon or Intel.","commonSituations":"New .NET runtime introducing an Architecture enum member the switch doesn't list; exotic virtualization reporting an odd architecture; macOS-on-ARM running under a non-standard ABI. Intel and Apple Silicon are both covered, so normal Macs never hit this.","solutions":["Confirm RuntimeInformation.ProcessArchitecture on the failing machine — if it's an unexpected value, investigate the runtime/host.","Run on standard Apple Silicon (Arm64) or Intel (X64) macOS, both of which have URLs.","If a legitimate new architecture must be supported, add its case returning the corresponding FFmpeg build URL."],"exampleFix":"// before\nswitch (RuntimeInformation.ProcessArchitecture)\n{\n    case Architecture.Arm64: return MacUrlArm;\n    case Architecture.X64:   return MacUrl;\n    default: throw new PlatformNotSupportedException(\"Unsupported macOS architecture.\");\n}\n\n// after: add explicit handling for the new arch\nswitch (RuntimeInformation.ProcessArchitecture)\n{\n    case Architecture.Arm64: return MacUrlArm;\n    case Architecture.X64:   return MacUrl;\n    case Architecture.Arm:   return MacUrlArm; // 32-bit ARM fallback\n    default: throw new PlatformNotSupportedException($\"Unsupported macOS architecture: {RuntimeInformation.ProcessArchitecture}\");\n}","handlingStrategy":"validation","validationCode":"static bool IsFfmpegSupportedOnMac()\n    => !OperatingSystem.IsMacOS()\n       || RuntimeInformation.ProcessArchitecture is Architecture.Arm64 or Architecture.X64;\n\nif (!IsFfmpegSupportedOnMac()) { DisableFfmpegDownload(); return; }","typeGuard":"static bool FfmpegMacSupported()\n    => !OperatingSystem.IsMacOS()\n       || RuntimeInformation.ProcessArchitecture is Architecture.Arm64 or Architecture.X64;","tryCatchPattern":"try { var url = FfmpegDownloadService.GetUrl(); }\ncatch (PlatformNotSupportedException ex) when (OperatingSystem.IsMacOS())\n{ _logger.Warning(\"FFmpeg download disabled on this Mac arch: {Arch}\", RuntimeInformation.ProcessArchitecture); DisableFfmpegDownload(); }","preventionTips":["Log ProcessArchitecture on macOS to spot misreported values.","Add explicit cases when adopting new .NET runtimes that introduce Architecture members.","Provide a manual FFmpeg install path for unsupported arches."],"tags":["platform","macos","architecture","ffmpeg","download"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}