Showing the changes to TOOLS/lua/cycle-deinterlace-pullup.lua (1 of 2 files). Show all
Unified · Split
| @@ -15,10 +15,10 @@ · 14 unmodified lines | |||
| 15 | -- TODO: It might make sense to use hardware assisted vdpaupp=pullup, | 15 | -- TODO: It might make sense to use hardware assisted vdpaupp=pullup, |
| 16 | -- if available, but I don't have hardware to test it. Patch welcome. | 16 | -- if available, but I don't have hardware to test it. Patch welcome. |
| 17 | 17 | ||
| 18 | script_name = mp.get_script_name() | 18 | local script_name = mp.get_script_name() |
| 19 | pullup_label = string.format("%s-pullup", script_name) | 19 | local pullup_label = string.format("%s-pullup", script_name) |
| 20 | 20 | ||
| 21 | function pullup_on() | 21 | local function pullup_on() |
| 22 | for _, vf in pairs(mp.get_property_native('vf')) do | 22 | for _, vf in pairs(mp.get_property_native('vf')) do |
| 23 | if vf['label'] == pullup_label then | 23 | if vf['label'] == pullup_label then |
| 24 | return "yes" | 24 | return "yes" |
| @@ -27,7 +27,7 @@ function pullup_on() · 2 unmodified lines | |||
| 27 | return "no" | 27 | return "no" |
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | function do_cycle() | 30 | local function do_cycle() |
| 31 | if pullup_on() == "yes" then | 31 | if pullup_on() == "yes" then |
| 32 | -- if pullup is on remove it | 32 | -- if pullup is on remove it |
| 33 | mp.command(string.format("vf del @%s:pullup", pullup_label)) | 33 | mp.command(string.format("vf del @%s:pullup", pullup_label)) |
| @@ -44,7 +44,7 @@ function do_cycle() · 10 unmodified lines | |||
| 44 | end | 44 | end |
| 45 | end | 45 | end |
| 46 | 46 | ||
| 47 | function cycle_deinterlace_pullup_handler() | 47 | local function cycle_deinterlace_pullup_handler() |
| 48 | do_cycle() | 48 | do_cycle() |
| 49 | -- independently determine current state and give user feedback | 49 | -- independently determine current state and give user feedback |
| 50 | mp.osd_message(string.format("deinterlace: %s\n".. | 50 | mp.osd_message(string.format("deinterlace: %s\n".. |