[grilo-plugins/0.2.x] lua-factory: Fix setting filesizes



commit b0e1b30d1013b451e8809a18262e7dedeb1e2f44
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 0f069c1..6335789 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]