mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 08:12:17 +00:00
lua: minor simplification
Using m_property_do() is more complicated, and will have to be changed later for mp_msg conversions.
This commit is contained in:
parent
eb15265d5a
commit
57359a1d62
@ -414,14 +414,13 @@ static int script_property_list(lua_State *L)
|
||||
|
||||
static int script_property_string(lua_State *L)
|
||||
{
|
||||
const struct m_option *props = mp_get_property_list();
|
||||
struct MPContext *mpctx = get_mpctx(L);
|
||||
const char *name = luaL_checkstring(L, 1);
|
||||
int type = lua_tointeger(L, lua_upvalueindex(1))
|
||||
? M_PROPERTY_PRINT : M_PROPERTY_GET_STRING;
|
||||
|
||||
char *result = NULL;
|
||||
if (m_property_do(props, name, type, &result, mpctx) >= 0 && result) {
|
||||
if (mp_property_do(name, type, &result, mpctx) >= 0 && result) {
|
||||
lua_pushstring(L, result);
|
||||
talloc_free(result);
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user