OSDN Git Service

MacGui: Remove Target Size as a rate control option as it doesn't really work correct...
[handbrake-jp/handbrake-jp-git.git] / gtk / src / plist.c
index 83e9326..05d6fdd 100644 (file)
@@ -377,6 +377,8 @@ ghb_plist_parse(const gchar *buf, gssize len)
        g_markup_parse_context_parse(ctx, buf, len, &err);
        g_markup_parse_context_end_parse(ctx, &err);
        g_markup_parse_context_free(ctx);
+       if (pd.key) g_free(pd.key);
+       if (pd.value) g_free(pd.value);
        g_queue_free(pd.stack);
        g_queue_free(pd.tag_stack);
        return pd.plist;
@@ -392,7 +394,10 @@ ghb_plist_parse_file(const gchar *filename)
 
        fd = g_fopen(filename, "r");
        if (fd == NULL)
+       {
+               g_warning("Plist parse: failed to open %s", filename);
                return NULL;
+       }
        fseek(fd, 0, SEEK_END);
        size = ftell(fd);
        fseek(fd, 0, SEEK_SET);
@@ -520,6 +525,11 @@ gval_write(FILE *file, GValue *gval)
                gint val = g_value_get_int64(gval);
                indent_fprintf(file, indent, "<integer>%d</integer>\n", val);
        }
+       else if (gtype == G_TYPE_INT)
+       {
+               gint val = g_value_get_int(gval);
+               indent_fprintf(file, indent, "<integer>%d</integer>\n", val);
+       }
        else if (gtype == G_TYPE_STRING)
        {
                const gchar *str = g_value_get_string(gval);