From 0319be747095398f481fdf23b562c57dd0ff52c0 Mon Sep 17 00:00:00 2001 From: Donough Liu Date: Mon, 26 Aug 2024 12:53:35 +0800 Subject: [PATCH] Update `rusty_ffmpeg` to `0.16.1` (#189) * Update `rusty_ffmpeg` to `0.16.1` * fix clippy * Update Windows CI check --- .github/workflows/ci.yml | 3 +-- Cargo.toml | 6 ++++-- src/avformat/avformat.rs | 3 +-- src/swresample/swresample.rs | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc3f050..f9c0aef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,8 +90,7 @@ jobs: VCPKG_ROOT: ${{ github.workspace }}/vcpkg LIBCLANG_PATH: ${{ github.workspace }}/clang/lib LLVM_CONFIG_PATH: ${{ github.workspace }}/clang/bin/llvm-config - # vcpkg doesn't provide FFmpeg 7 yet (https://github.com/microsoft/vcpkg/issues/37888) - run: cargo clippy --no-default-features --features ffmpeg6 -- -D warnings + run: cargo clippy --no-default-features --features ffmpeg7,link_vcpkg_ffmpeg -- -D warnings build_static_and_test_ubuntu: runs-on: ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index 77bf249..7a64e38 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ exclude = ["/.github", "/tests", "/utils"] rust-version = "1.70.0" [dependencies] -rusty_ffmpeg = "0.14.0" +rusty_ffmpeg = "0.16.1" paste = "1.0" thiserror = "1.0" @@ -34,5 +34,7 @@ default = ["ffmpeg7"] ffmpeg6 = ["rusty_ffmpeg/ffmpeg6"] ffmpeg7 = ["ffmpeg6", "rusty_ffmpeg/ffmpeg7"] -# linking system ffmpeg as fallback. +# Try linking ffmpeg with pkg-config. link_system_ffmpeg = ["rusty_ffmpeg/link_system_ffmpeg"] +# Try linking ffmpeg with vcpkg. +link_vcpkg_ffmpeg = ["rusty_ffmpeg/link_vcpkg_ffmpeg"] diff --git a/src/avformat/avformat.rs b/src/avformat/avformat.rs index dcdd3ef..938b16c 100644 --- a/src/avformat/avformat.rs +++ b/src/avformat/avformat.rs @@ -31,8 +31,7 @@ impl AVFormatContextInput { /// all streams. /// /// - `url`: url of the stream to open. - /// - `format`: input format hint. If `format` is some, this parameter forces - /// a specific input format. + /// - `format`: input format hint. If `format` is some, this parameter forces a specific input format. /// - `options`: A dictionary filled with AVFormatContext and demuxer-private options. /// On return this parameter will be destroyed and replaced with a dict containing /// options that were not found. diff --git a/src/swresample/swresample.rs b/src/swresample/swresample.rs index f7639d2..2747eab 100644 --- a/src/swresample/swresample.rs +++ b/src/swresample/swresample.rs @@ -90,6 +90,7 @@ impl SwrContext { /// - if it's the least common multiple of in_sample_rate and /// out_sample_rate then an exact rounding-free delay will be /// returned + /// /// returns the delay in `1 / base` base units. pub fn get_delay(&self, base: usize) -> usize { unsafe { ffi::swr_get_delay(self.as_ptr() as *mut _, base.try_into().unwrap()) }