[grilo-plugins] lua-factory: Fix setting filesizes
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins] lua-factory: Fix setting filesizes
- Date: Sat, 10 Oct 2015 12:51:30 +0000 (UTC)
commit 753d3e8c2d2531172e781e0722ab53a9e3f27427
Author: Bastien Nocera <hadess hadess net>
Date: Sun Oct 4 16:10:42 2015 +0200
lua-factory: Fix setting filesizes
Filesizes are int64, therefore, don't use grl_data_add_int() for it.
https://bugzilla.gnome.org/show_bug.cgi?id=755556
src/lua-factory/grl-lua-library.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/lua-factory/grl-lua-library.c b/src/lua-factory/grl-lua-library.c
index 5db3380..a33ed77 100644
--- a/src/lua-factory/grl-lua-library.c
+++ b/src/lua-factory/grl-lua-library.c
@@ -268,9 +268,13 @@ grl_util_add_table_to_media (lua_State *L,
case G_TYPE_INT64:
if (lua_isnumber (L, -1)) {
gint success;
- gint value = lua_tointegerx (L, -1, &success);
- if (success)
- grl_data_add_int (GRL_DATA (media), key_id, value);
+ gint64 value = lua_tointegerx (L, -1, &success);
+ if (success) {
+ if (type == G_TYPE_INT)
+ grl_data_add_int (GRL_DATA (media), key_id, value);
+ else
+ grl_data_add_int64 (GRL_DATA (media), key_id, value);
+ }
}
break;
@@ -351,7 +355,7 @@ grl_util_build_media (lua_State *L,
case G_TYPE_INT64:
if (lua_isnumber (L, -1)) {
gint success;
- gint value = lua_tointegerx (L, -1, &success);
+ gint64 value = lua_tointegerx (L, -1, &success);
if (success) {
if (type == G_TYPE_INT)
grl_data_set_int (GRL_DATA (media), key_id, value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]