Skip to content

fix: Use version-agnostic library names for FFmpeg DLLs on Windows - #757

Open
kt286 wants to merge 1 commit into
linuxdeepin:masterfrom
kt286:fix/ffmpeg_version
Open

fix: Use version-agnostic library names for FFmpeg DLLs on Windows#757
kt286 wants to merge 1 commit into
linuxdeepin:masterfrom
kt286:fix/ffmpeg_version

Conversation

@kt286

@kt286 kt286 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Remove hardcoded version suffixes (e.g. avcodec-63) from FFmpeg library names so that libPath's wildcard matching can automatically resolve the latest available version at runtime.

fix: Windows 下使用无版本号的 FFmpeg 库名以实现动态适配

移除 FFmpeg 库名中硬编码的版本号后缀(如 avcodec-63),使 libPath 的通配 符匹配机制能够自动解析运行时可用的最新版本,避免因 FFmpeg 版本更替导致库加载失败。

Summary by Sourcery

Bug Fixes:

  • Enable Windows FFmpeg libraries to load across version changes by using version-agnostic library names for runtime resolution.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kt286

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

Hi @kt286. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai

sourcery-ai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

On Windows, the PR removes hardcoded FFmpeg DLL version suffixes and switches to version-agnostic library base names so that existing wildcard-based libPath resolution can automatically locate the latest installed FFmpeg DLLs at runtime.

Sequence diagram for Windows FFmpeg DLL loading with version-agnostic names

sequenceDiagram
    participant Application
    participant dynamiclibraries
    participant libPath
    participant WindowsLoader
    participant FFmpeg_avcodec_DLL

    Application->>dynamiclibraries: loadFFmpegLibraries()
    dynamiclibraries->>libPath: resolveLibraryPath(libavcodecStr)
    Note over dynamiclibraries,libPath: libavcodecStr is now "avcodec" (no version suffix)
    libPath->>WindowsLoader: searchDLL("avcodec*.dll")
    WindowsLoader-->>libPath: matched path to latest avcodec DLL
    libPath-->>dynamiclibraries: return resolved DLL path
    dynamiclibraries->>WindowsLoader: loadLibrary(resolved path)
    WindowsLoader-->>dynamiclibraries: handle to FFmpeg_avcodec_DLL
    dynamiclibraries-->>Application: FFmpeg ready with latest available version
Loading

File-Level Changes

Change Details Files
Make FFmpeg DLL names version-agnostic on Windows to rely on wildcard-based runtime resolution instead of fixed version numbers.
  • Update the Windows FFmpeg library name constants to use base names without numeric version suffixes.
  • Keep non-Windows (Unix-like) library names unchanged, preserving .so suffix-based resolution.
  • Align all FFmpeg-related dynamic loading on Windows with the existing libPath wildcard matching mechanism to reduce maintenance during FFmpeg upgrades.
src/libdmusic/core/dynamiclibraries.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/libdmusic/core/dynamiclibraries.cpp" line_range="19" />
<code_context>
-static const QString libavutilStr = "avutil-60";
-static const QString libswresampleStr = "swresample-6";
+static const QString libavcodecStr = "avcodec";
+static const QString libavformateStr = "avformat";
+static const QString libavutilStr = "avutil";
+static const QString libswresampleStr = "swresample";
</code_context>
<issue_to_address>
**nitpick (typo):** The identifier `libavformateStr` appears to have a typo in its name which reduces readability.

Renaming `libavformateStr` to `libavformatStr` would better reflect the referenced library and improve code readability.

Suggested implementation:

```cpp
static const QString libavcodecStr = "avcodec";
static const QString libavformatStr = "avformat";
static const QString libavutilStr = "avutil";

```

Any other occurrences of `libavformateStr` in this file (or related source files) should be renamed to `libavformatStr` to keep usage consistent and avoid build errors. Search the codebase for `libavformateStr` and update references accordingly.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/libdmusic/core/dynamiclibraries.cpp Outdated
@kt286
kt286 force-pushed the fix/ffmpeg_version branch from db085eb to 77b9825 Compare August 11, 2026 06:54
@deepin-bot

deepin-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 7.0.63
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #762

@deepin-bot

deepin-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 7.0.64
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #765

@kt286
kt286 force-pushed the fix/ffmpeg_version branch from 77b9825 to 8b164f4 Compare August 18, 2026 05:29
@deepin-bot

deepin-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 7.0.65
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #768

@deepin-bot

deepin-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 7.0.66
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #779

Remove hardcoded version suffixes (e.g. avcodec-63) from FFmpeg library
names so that libPath's wildcard matching can automatically resolve the
latest available version at runtime.

fix: Windows 下使用无版本号的 FFmpeg 库名以实现动态适配

移除 FFmpeg 库名中硬编码的版本号后缀(如 avcodec-63),使 libPath 的通配
符匹配机制能够自动解析运行时可用的最新版本,避免因 FFmpeg 版本更替导致
库加载失败。
@kt286
kt286 force-pushed the fix/ffmpeg_version branch from 8b164f4 to f156ca5 Compare August 20, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants