rtmp-services: Add get_int_val hepler function

This is just for accessing a json object.  I should be using obs_data_t
for this instead of json directly, but it doesn't really matter.
This commit is contained in:
jp9000 2015-08-19 15:46:28 -07:00
parent 0d30d1229f
commit d08701338f

View File

@ -54,6 +54,15 @@ static inline const char *get_string_val(json_t *service, const char *key)
return json_string_value(str_val);
}
static inline int get_int_val(json_t *service, const char *key)
{
json_t *integer_val = json_object_get(service, key);
if (!integer_val || !json_is_integer(integer_val))
return 0;
return (int)json_integer_value(integer_val);
}
static inline bool get_bool_val(json_t *service, const char *key)
{
json_t *bool_val = json_object_get(service, key);