diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2014-10-19 23:12:34 -0700 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-21 00:55:15 +0200 |
commit | 3617399a46b59cc115c6c124f8a198a12ff3f972 (patch) | |
tree | 3ef7223f68182ad2f8e1665c4bf4488c9c4caafc /TOOLS/lua/autocrop.lua | |
parent | e68cc34c990907fb8c5fe2a3c690671bac38e618 (diff) | |
download | mpv-3617399a46b59cc115c6c124f8a198a12ff3f972.tar.bz2 mpv-3617399a46b59cc115c6c124f8a198a12ff3f972.tar.xz |
TOOLS/lua: remove tabs from some lua scripts
Diffstat (limited to 'TOOLS/lua/autocrop.lua')
-rw-r--r-- | TOOLS/lua/autocrop.lua | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/TOOLS/lua/autocrop.lua b/TOOLS/lua/autocrop.lua index bf598e8b05..cbc4c252ff 100644 --- a/TOOLS/lua/autocrop.lua +++ b/TOOLS/lua/autocrop.lua @@ -42,11 +42,11 @@ function del_filter_if_present(label) -- error if the filter doesn't exist local vfs = mp.get_property_native("vf") for i,vf in pairs(vfs) do - if vf["label"] == label then - table.remove(vfs, i) - mp.set_property_native("vf", vfs) - return true - end + if vf["label"] == label then + table.remove(vfs, i) + mp.set_property_native("vf", vfs) + return true + end end return false end @@ -65,10 +65,10 @@ function autocrop_start() -- insert the cropdetect filter ret=mp.command( - string.format( - 'vf add @%s:lavfi=graph="cropdetect=limit=24:round=2:reset=0"', - cropdetect_label - ) + string.format( + 'vf add @%s:lavfi=graph="cropdetect=limit=24:round=2:reset=0"', + cropdetect_label + ) ) -- wait to gather data timer=mp.add_timeout(detect_seconds, do_crop) @@ -77,15 +77,15 @@ end function do_crop() -- get the metadata local cropdetect_metadata = mp.get_property_native( - string.format("vf-metadata/%s", cropdetect_label) + string.format("vf-metadata/%s", cropdetect_label) ) -- use it to crop if its valid if cropdetect_metadata then - if cropdetect_metadata["lavfi.cropdetect.w"] - and cropdetect_metadata["lavfi.cropdetect.h"] - and cropdetect_metadata["lavfi.cropdetect.x"] - and cropdetect_metadata["lavfi.cropdetect.y"] - then + if cropdetect_metadata["lavfi.cropdetect.w"] + and cropdetect_metadata["lavfi.cropdetect.h"] + and cropdetect_metadata["lavfi.cropdetect.x"] + and cropdetect_metadata["lavfi.cropdetect.y"] + then mp.command(string.format("vf add @%s:crop=%s:%s:%s:%s", crop_label, cropdetect_metadata["lavfi.cropdetect.w"], @@ -94,9 +94,9 @@ function do_crop() cropdetect_metadata["lavfi.cropdetect.y"])) else mp.msg.error( - "Got empty crop data. You might need to increase detect_seconds." - ) - end + "Got empty crop data. You might need to increase detect_seconds." + ) + end else mp.msg.error( "No crop data. Was the cropdetect filter successfully inserted?" |