state-stream: fix using the default volume
When there was no previous state stored, the default volume was also not applied because the code would return from the hook early Fixes: #655
This commit is contained in:
@@ -52,10 +52,7 @@ restore_stream_hook = SimpleEventHook {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local stored_values = getStoredStreamProps (key)
|
local stored_values = getStoredStreamProps (key) or {}
|
||||||
if not stored_values then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- restore node Props (volumes, channelMap, etc...)
|
-- restore node Props (volumes, channelMap, etc...)
|
||||||
if Settings.get_boolean ("node.stream.restore-props") and stream_props ["state.restore-props"] ~= "false"
|
if Settings.get_boolean ("node.stream.restore-props") and stream_props ["state.restore-props"] ~= "false"
|
||||||
@@ -356,11 +353,14 @@ function buildDefaultChannelVolumes (node)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
log:info (node, "using default volume: " .. tostring(def_vol) ..
|
||||||
|
", channels: " .. tostring(channels))
|
||||||
|
|
||||||
while (#res < channels) do
|
while (#res < channels) do
|
||||||
table.insert(res, def_vol)
|
table.insert(res, def_vol)
|
||||||
end
|
end
|
||||||
|
|
||||||
return res;
|
return res
|
||||||
end
|
end
|
||||||
|
|
||||||
function getStoredStreamProps (key)
|
function getStoredStreamProps (key)
|
||||||
|
Reference in New Issue
Block a user