avoid hang if the user specified non-existent preset
This commit is contained in:
parent
97296e1edf
commit
d46f3b0134
|
@ -31,6 +31,18 @@ local encoder
|
|||
local OSD
|
||||
local Timings
|
||||
|
||||
local presets = {
|
||||
ultrafast = true,
|
||||
superfast = true,
|
||||
veryfast = true,
|
||||
faster = true,
|
||||
fast = true,
|
||||
medium = true,
|
||||
slow = true,
|
||||
slower = true,
|
||||
veryslow = true,
|
||||
}
|
||||
|
||||
------------------------------------------------------------
|
||||
-- utility functions
|
||||
|
||||
|
@ -335,6 +347,10 @@ if not config.audio_bitrate:endswith('k') then
|
|||
config.audio_bitrate = config.audio_bitrate .. 'k'
|
||||
end
|
||||
|
||||
if not presets[config.preset] then
|
||||
config.preset = 'faster'
|
||||
end
|
||||
|
||||
------------------------------------------------------------
|
||||
-- Finally, set an 'entry point' in mpv
|
||||
|
||||
|
|
Loading…
Reference in a new issue