Skip to content

Commit

Permalink
feat: add download url for mac m1
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanbabcock committed Sep 17, 2023
1 parent 8038971 commit 94d81af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ffmpeg-sidecar"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
description = "Wrap a standalone FFmpeg binary in an intuitive Iterator interface."
authors = ["Nathan Babcock <nathan.r.babcock@gmail.com>"]
Expand Down
20 changes: 9 additions & 11 deletions src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,18 @@ pub fn ffmpeg_manifest_url() -> Result<&'static str> {
/// URL for the latest published FFmpeg release. The correct URL for the target
/// platform is baked in at compile time.
pub fn ffmpeg_download_url() -> Result<&'static str> {
if cfg!(not(target_arch = "x86_64")) {
return Err(Error::msg(
"Downloads must be manually provided for non-x86_64 architectures",
));
}

if cfg!(target_os = "windows") {
if cfg!(all(target_os = "windows", target_arch = "x86_64")) {
Ok("https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip")
} else if cfg!(target_os = "macos") {
Ok("https://evermeet.cx/ffmpeg/getrelease")
} else if cfg!(target_os = "linux") {
} else if cfg!(all(target_os = "linux", target_arch = "x86_64")) {
Ok("https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz")
} else if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
Ok("https://evermeet.cx/ffmpeg/getrelease")
} else if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
Ok("https://www.osxexperts.net/ffmpeg6arm.zip") // Mac M1
} else {
Err(Error::msg("Unsupported platform"))
Err(Error::msg(
"Unsupported platform; you can provide your own URL instead and call download_ffmpeg_package directly.",
))
}
}

Expand Down

0 comments on commit 94d81af

Please sign in to comment.