[grilo-plugins/0.2.x] lua-factory: fix use of wrong grl_data_set_int
- From: Juan A. Suárez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins/0.2.x] lua-factory: fix use of wrong grl_data_set_int
- Date: Sat, 19 Dec 2015 23:43:20 +0000 (UTC)
commit 34db702f40e1e1584a12fd13e43007b1df5567af
Author: Victor Toso <me victortoso com>
Date: Thu Sep 24 17:56:03 2015 +0200
lua-factory: fix use of wrong grl_data_set_int
commit 1e20497737db94c0932a12b4395859 changed the behavior and current
tests got it. grl_data_set_int64 should be used with G_TYPE_INT64 or
else we would fail with:
data/grl-related-keys.c:253: value has type gint, but expected gint64
https://bugzilla.gnome.org/show_bug.cgi?id=755447
src/lua-factory/grl-lua-library.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/lua-factory/grl-lua-library.c b/src/lua-factory/grl-lua-library.c
index b480c47..0f069c1 100644
--- a/src/lua-factory/grl-lua-library.c
+++ b/src/lua-factory/grl-lua-library.c
@@ -352,11 +352,15 @@ grl_util_build_media (lua_State *L,
if (lua_isnumber (L, -1)) {
gint success;
gint value = lua_tointegerx (L, -1, &success);
- if (success)
- grl_data_set_int (GRL_DATA (media), key_id, value);
- else
+ if (success) {
+ if (type == G_TYPE_INT)
+ grl_data_set_int (GRL_DATA (media), key_id, value);
+ else
+ grl_data_set_int64 (GRL_DATA (media), key_id, value);
+ } else {
GRL_WARNING ("'%s' requires an INT type, while a value '%s' was provided",
key_name, lua_tostring(L, -1));
+ }
} else if (lua_istable (L, -1)) {
grl_util_add_table_to_media (L, media, key_id, key_name, type);
} else if (!lua_isnil (L, -1)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]