summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-20 23:05:52 +0200
committerwm4 <wm4@nowhere>2015-04-20 23:09:34 +0200
commitccfe4d64184ae4c2983ae6b099c7c7ebb3770d0f (patch)
tree7f68f8110e1aefa082198bac86a83956cac884cc /player
parent2469cb5d1f6056f770ef3e454773595b9f720faa (diff)
downloadmpv-ccfe4d64184ae4c2983ae6b099c7c7ebb3770d0f.tar.bz2
mpv-ccfe4d64184ae4c2983ae6b099c7c7ebb3770d0f.tar.xz
client API: add MPV_FORMAT_BYTE_ARRAY type
This will be used in the following commit, which adds screenshot_raw. The reasoning is that this will be better for binding scripting languages. One could special-case the screenshot_raw commit and define fixed semantics for passing through a pointer using the current API, like formatting a pointer as string. But that would be ridiculous and unclean.
Diffstat (limited to 'player')
-rw-r--r--player/lua.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/player/lua.c b/player/lua.c
index 43f549b4ed..51c0e1a752 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -860,6 +860,9 @@ static void pushnode(lua_State *L, mpv_node *node)
lua_rawset(L, -3);
}
break;
+ case MPV_FORMAT_BYTE_ARRAY:
+ lua_pushlstring(L, node->u.ba->data, node->u.ba->size);
+ break;
default:
// unknown value - what do we do?
// for now, set a unique dummy value