Skip to content

Commit 7ae05b2

Browse files
committed
Make disabling of hardware decoding optional
1 parent 5077a9b commit 7ae05b2

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

script-opts/blur_edges.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ watch_later_fix=no
2424

2525
# only apply the blur effect when mpv is set to fullscreen
2626
only_fullscreen=yes
27+
28+
# This script will likely not work with hardware decoding, therefore disable it
29+
# when activating the blur
30+
disable_hwdec=yes

scripts/blur-edges.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ local opts = {
99
reapply_delay = 0.5,
1010
watch_later_fix = false,
1111
only_fullscreen = true,
12+
disable_hwdec = true,
1213
}
1314
options.read_options(opts)
1415

@@ -127,10 +128,14 @@ function toggle()
127128
active = false
128129
unset_blur()
129130
mp.unobserve_property(reset_blur)
130-
mp.set_property("hwdec", orig_value_hwdec)
131+
if opts.disable_hwdec then
132+
mp.set_property("hwdec", orig_value_hwdec)
133+
end
131134
else
132-
orig_value_hwdec = mp.get_property("hwdec")
133-
mp.set_property("hwdec", "no")
135+
if opts.disable_hwdec then
136+
orig_value_hwdec = mp.get_property("hwdec")
137+
mp.set_property("hwdec", "no")
138+
end
134139
active = true
135140
set_blur()
136141
local properties = { "osd-width", "osd-height", "path", "fullscreen" }

0 commit comments

Comments
 (0)