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:
wm4 2013-12-21 18:18:31 +01:00
parent eb15265d5a
commit 57359a1d62
1 changed files with 1 additions and 2 deletions

View File

@ -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;