Skip to content

Commit

Permalink
Make disabling of hardware decoding optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Nudin committed Oct 7, 2020
1 parent 5077a9b commit de456d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions script-opts/blur_edges.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ watch_later_fix=no

# only apply the blur effect when mpv is set to fullscreen
only_fullscreen=yes

# This script will likely not work with hardware decoding, therefore disable it
# when activating the blur
disable_hwdec=yes
9 changes: 7 additions & 2 deletions scripts/blur-edges.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ local opts = {
reapply_delay = 0.5,
watch_later_fix = false,
only_fullscreen = true,
disable_hwdec = true,
}
options.read_options(opts)

Expand Down Expand Up @@ -127,10 +128,14 @@ function toggle()
active = false
unset_blur()
mp.unobserve_property(reset_blur)
mp.set_property("hwdec", orig_value_hwdec)
if disable_hwdec then
mp.set_property("hwdec", orig_value_hwdec)
end
else
orig_value_hwdec = mp.get_property("hwdec")
mp.set_property("hwdec", "no")
if disable_hwdec then
mp.set_property("hwdec", "no")
end
active = true
set_blur()
local properties = { "osd-width", "osd-height", "path", "fullscreen" }
Expand Down

0 comments on commit de456d2

Please sign in to comment.