Skip to content

Commit 5bc8a30

Browse files
committed
Add MPV hardware decode option to settings
Adds a "Hardware Decode" ComboBox in MPV settings (Auto/Software), allowing users to disable hardware decoding as a workaround for kernel slab memory leaks observed with AMD RDNA 4 GPUs (RX 9070 XT).
1 parent 5a72d38 commit 5bc8a30

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

plugin/contents/config/main.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@
7070
<label>Mpv Stats</label>
7171
<default>false</default>
7272
</entry>
73+
<entry name="MpvHwdec" type="String">
74+
<label>Mpv Hardware Decode</label>
75+
<default>auto</default>
76+
</entry>
7377
<entry name="MouseInput" type="Bool">
7478
<label>Mouse Input</label>
7579
<default>true</default>

plugin/contents/ui/backend/Mpv.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,17 @@ Item{
6565
}
6666
}
6767
}
68+
Connections {
69+
target: background
70+
function onMpvHwdecChanged() {
71+
player.setProperty("hwdec", background.mpvHwdec);
72+
}
73+
}
74+
6875
Component.onCompleted:{
6976
background.nowBackend = 'mpv';
7077
videoItem.displayModeChanged();
78+
player.setProperty("hwdec", background.mpvHwdec);
7179
}
7280

7381
function play(){

plugin/contents/ui/main.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Rectangle {
2323
property bool noRandomWhilePaused: wallpaper.configuration.NoRandomWhilePaused
2424
property bool mouseInput: wallpaper.configuration.MouseInput
2525
property bool mpvStats: wallpaper.configuration.MpvStats
26+
property string mpvHwdec: wallpaper.configuration.MpvHwdec
2627

2728
property bool pauseOnBatPower: wallpaper.configuration.PauseOnBatPower
2829
property int pauseBatPercent: wallpaper.configuration.PauseBatPercent

plugin/contents/ui/page/SettingPage.qml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Flickable {
2020
property alias cfg_Fps: sliderFps.value
2121
property alias cfg_Volume: sliderVol.value
2222
property alias cfg_MpvStats: ckbox_mpvStats.checked
23+
property string cfg_MpvHwdec
2324
property alias cfg_Speed: spin_speed.dValue
2425
property alias cfg_MuteAudio: ckbox_muteAudio.checked
2526
property alias cfg_MouseInput: ckbox_mouseInput.checked
@@ -317,6 +318,30 @@ Flickable {
317318
id: ckbox_mpvStats
318319
}
319320
}
321+
322+
OptionItem {
323+
text: 'Hardware Decode'
324+
text_color: Kirigami.Theme.textColor
325+
icon: '../../images/plugin.svg'
326+
visible: cfg_VideoBackend == Common.VideoBackend.Mpv
327+
actor: ComboBox {
328+
id: cbox_mpvHwdec
329+
model: [
330+
{ text: "Auto", value: "auto" },
331+
{ text: "Software", value: "no" }
332+
]
333+
textRole: "text"
334+
onActivated: cfg_MpvHwdec = model[currentIndex].value
335+
Component.onCompleted: {
336+
for (let i = 0; i < model.length; i++) {
337+
if (model[i].value === cfg_MpvHwdec) {
338+
currentIndex = i;
339+
break;
340+
}
341+
}
342+
}
343+
}
344+
}
320345
}
321346
OptionGroup {
322347
Layout.fillWidth: true

0 commit comments

Comments
 (0)