0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 11:22:00 +01:00

wtf is this

This commit is contained in:
2025-12-23 15:19:08 +01:00
parent a41950e976
commit f1a38da312

View File

@@ -243,11 +243,15 @@ int run_fm95(const FM95_Config config, FM95_Runtime* runtime) {
mod_r = apply_preemphasis(&runtime->preemp_r, mod_r);
}
lua_pushnumber(runtime->lua, mod_l);
lua_setglobal(runtime->lua, "left");
lua_pushnumber(runtime->lua, mod_r);
lua_setglobal(runtime->lua, "right");
lua_pcall(runtime->lua, 0, 0, 0);
lua_rawgeti(L, LUA_REGISTRYINDEX, runtime->script_ref);
lua_pushnumber(L, mod_l); // Argument 1
lua_pushnumber(L, mod_r); // Argument 2
if (lua_pcall(L, 2, 2, 0) == LUA_OK) { // 2 args, 2 results
mod_r = lua_tonumber(L, -1);
mod_l = lua_tonumber(L, -2);
lua_pop(L, 2);
}
mpx = stereo_encode(&runtime->stencode, config.stereo, mod_l, mod_r);