Merge branch 'master' into next

This commit is contained in:
George Kiagiadakis
2023-10-24 11:09:52 +03:00
12 changed files with 295 additions and 27 deletions

View File

@@ -6,6 +6,7 @@
* SPDX-License-Identifier: MIT
*/
#include "lua.h"
#include <glib/gstdio.h>
#include <wp/wp.h>
#include <pipewire/pipewire.h>
@@ -1536,8 +1537,20 @@ impl_module_new (lua_State *L)
properties = wplua_table_to_properties (L, 3);
}
WpImplModule *m = wp_impl_module_load (get_wp_export_core (L),
name, args, properties);
bool load_file = false; // Load args as file path
if (lua_type (L, 4) != LUA_TNONE && lua_type (L, 4) != LUA_TNIL) {
luaL_checktype (L, 4, LUA_TBOOLEAN);
load_file = lua_toboolean(L, 4);
}
WpImplModule *m = NULL;
if (load_file) {
m = wp_impl_module_load_file (get_wp_export_core (L),
name, args, properties);
} else {
m = wp_impl_module_load (get_wp_export_core (L),
name, args, properties);
}
if (m) {
wplua_pushobject (L, m);