changeset 651:b9167008fc3f trunk

[svn] - strings in audmad_config should be freed before update. thus constant initializer has been replaced with g_strdup().
author yaz
date Wed, 14 Feb 2007 18:03:22 -0800
parents 8b9ef7a32e47
children 7f865e3cd285
files ChangeLog src/madplug/configure.c src/madplug/plugin.c
diffstat 3 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Feb 14 10:15:53 2007 -0800
+++ b/ChangeLog	Wed Feb 14 18:03:22 2007 -0800
@@ -1,3 +1,11 @@
+2007-02-14 18:15:53 +0000  William Pitcock <nenolod@sacredspiral.co.uk>
+  revision [1386]
+  - make sure audmad_config.id3_format is not NULL. closes #795.
+  
+  trunk/src/madplug/plugin.c |    2 ++
+  1 file changed, 2 insertions(+)
+
+
 2007-02-14 15:24:59 +0000  
   revision [1384]
   * Update Japanese translation.
--- a/src/madplug/configure.c	Wed Feb 14 10:15:53 2007 -0800
+++ b/src/madplug/configure.c	Wed Feb 14 18:03:22 2007 -0800
@@ -57,15 +57,18 @@
     audmad_config.hard_limit =
         gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hard_limit));
     text = gtk_entry_get_text(GTK_ENTRY(RG_default));
+    g_free(audmad_config.replaygain.default_db);
     audmad_config.replaygain.default_db = g_strdup(text);
 
     text = gtk_entry_get_text(GTK_ENTRY(pregain));
+    g_free(audmad_config.pregain_db);
     audmad_config.pregain_db = g_strdup(text);
 
     audmad_config.title_override =
         gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override));
 
     text = gtk_entry_get_text(GTK_ENTRY(title_id3_entry));
+    g_free(audmad_config.id3_format);
     audmad_config.id3_format = g_strdup(text);
 
     audmad_config_compute(&audmad_config);
--- a/src/madplug/plugin.c	Wed Feb 14 10:15:53 2007 -0800
+++ b/src/madplug/plugin.c	Wed Feb 14 18:03:22 2007 -0800
@@ -103,11 +103,10 @@
     audmad_config.use_xing = TRUE;
     audmad_config.dither = TRUE;
     audmad_config.sjis = FALSE;
-    audmad_config.pregain_db = "+0.00";
+    audmad_config.hard_limit = FALSE;
     audmad_config.replaygain.enable = TRUE;
     audmad_config.replaygain.track_mode = FALSE;
-    audmad_config.hard_limit = FALSE;
-    audmad_config.replaygain.default_db = "-9.00";
+    audmad_config.title_override = FALSE;
 
     db = bmp_cfg_db_open();
     if (db) {
@@ -140,7 +139,13 @@
     mad_cond = g_cond_new();
     audmad_config_compute(&audmad_config);
 
-    if (audmad_config.id3_format != NULL)
+    if (!audmad_config.pregain_db)
+        audmad_config.pregain_db = g_strdup("+0.00");
+
+    if (!audmad_config.replaygain.default_db)
+        audmad_config.replaygain.default_db = g_strdup("-9.00");
+
+    if (!audmad_config.id3_format)
         audmad_config.id3_format = g_strdup("");
 }