bugfix: hardware decoder issue in certain files, added support to swi…#57
Merged
Conversation
…tch between CPU/GPU decoder in playback settings
This was referenced Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Edited player_bridge.cpp
Edited player_bridge.cpp
Viewed controls.html:1-23
Here is the updated Pull Request description that properly explains the codec and hardware decoder logic:
Summary
Fixed playback black screens on Windows by correcting the
decoderPriorityUI-to-native mapping and resolving a critical hardware decoder codec compatibility issue by switching from forced D3D11VA to smart auto-probing.PR type
Why
We discovered two major issues causing black screens and playback failures on Windows:
hwdec=d3d11va(forcing the AMD GPU's Direct Rendering path). However, different GPUs support different codec profiles. For example, when playing aVC-1or unsupported Dolby Vision stream, forcing the AMD decoder resulted in silent failures and black screens. By changing the base configuration tohwdec=auto, MPV is now allowed to intelligently probe the system's capabilities at runtime. On dual-GPU systems (e.g., AMD + NVIDIA),autocorrectly discovers which GPU can actually handle the specific codec (e.g., selectingnvdec-copyvia NVIDIA CUDA for VC-1) instead of forcing a crash on the AMD card.Desktop scope
Windows only (
composeApp/src/desktopMain/native/windows/player_bridge.cpp).Issue or approval
No linked issue - fixes direct playback crash/black screen regression on Windows native player.
UI / behavior impact
Policy check
CONTRIBUTING.md.Scope boundaries
This fix does not change the UI text or alter how the Kotlin UI handles its state. It strictly aligns the C++ backend to receive the correct state and lets the MPV engine perform native codec probing.
Testing
Tested on Windows with a multi-GPU setup (AMD + NVIDIA) using various codecs (including
VC-1and HEVC).decoderPriority == 0(Device Only) runshwdec=auto. Log outputs proved that MPV successfully tests and selects the optimal decoder (nvdec-copyon NVIDIA) when the AMD direct path fails.decoderPriority == 1(Prefer Device) correctly appliesvd-lavc-software-fallback=yesalongsideauto, providing a safety net if no GPU supports the codec.decoderPriority == 2(App Decoders) runshwdec=noto force software decoding for absolute stability.Screenshots / Video
Before:

After:

Breaking changes
None.
Linked issues
26
Note to Author:
Please do check if the code changes are as expected, and hopefully, it should not break in any scenario. If I am missing anything, do let me know.
I have done the changes only for the Windows OS,
Current System Specs
AMD Ryzen 6800HS
32GB DDR5
NVIDIA RTX 3080 8GB Laptop Variant