OSDN Git Service

LinGui: accidentally commited x264 defaults changes prematurely, revert
[handbrake-jp/handbrake-jp-git.git] / gtk / src / presets.c
index ad2af5c..c17a902 100644 (file)
@@ -1392,6 +1392,8 @@ ghb_prefs_load(signal_user_data_t *ud)
                }
                ghb_dict_insert(dict, 
                        g_strdup("destination_dir"), ghb_value_dup(ghb_string_value(dir)));
+               ghb_dict_insert(dict, 
+                       g_strdup("SrtDir"), ghb_value_dup(ghb_string_value(dir)));
 #if defined(_WIN32)
                gchar *source;
 
@@ -1763,7 +1765,7 @@ static value_map_t acodec_xlat[] =
 value_map_t container_xlat[] =
 {
        {"MP4 file", "mp4"},
-       {"M4V file", "m4v"},
+       {"M4V file", "mp4"},
        {"MKV file", "mkv"},
        {"AVI file", "mkv"},
        {"OGM file", "mkv"},
@@ -2219,6 +2221,7 @@ import_value_xlat(GValue *dict)
        if (gval)
                ghb_dict_insert(dict, g_strdup(key), gval);
 
+
        GValue *sdeflist;
        GValue *sdefaults;
        GValue *slist;
@@ -2324,6 +2327,18 @@ import_value_xlat(GValue *dict)
                        gval = import_value_xlat2(adefaults, mix_xlat, key, mac_val);
                        if (gval)
                                ghb_dict_insert(adict, g_strdup(key), gval);
+
+                       mac_val = ghb_dict_lookup(adict, "AudioTrackDRCSlider");
+                       if (mac_val != NULL)
+                       {
+                               gdouble drc;
+                               drc = ghb_value_double(mac_val);
+                               if (drc < 1.0 && drc > 0.0)
+                               {
+                                       ghb_dict_insert(adict, g_strdup("AudioTrackDRCSlider"), 
+                                                                       ghb_double_value_new(0.0));
+                               }
+                       }
                }
        }
 }
@@ -2333,7 +2348,7 @@ import_xlat_preset(GValue *dict)
 {
        gboolean uses_max;
        gint uses_pic;
-       gint par, par_width, par_height;
+       gint par;
        gint vqtype;
 
        g_debug("import_xlat_preset ()");
@@ -2343,12 +2358,6 @@ import_xlat_preset(GValue *dict)
                                                preset_dict_get_value(dict, "UsesPictureSettings"));
        par = ghb_value_int(preset_dict_get_value(dict, "PicturePAR"));
        vqtype = ghb_value_int(preset_dict_get_value(dict, "VideoQualityType"));
-       par_width = ghb_value_int(preset_dict_get_value(dict, "PicturePARWidth"));
-       par_height = ghb_value_int(preset_dict_get_value(dict, "PicturePARHeight"));
-       ghb_dict_insert(dict, g_strdup("par_width"), 
-                                       ghb_int_value_new(par_width));
-       ghb_dict_insert(dict, g_strdup("par_height"), 
-                                       ghb_int_value_new(par_height));
 
        if (uses_max || uses_pic == 2)
        {
@@ -2492,7 +2501,6 @@ static void
 export_xlat_preset(GValue *dict)
 {
        gboolean autoscale, target, br, constant;
-       gint par_width, par_height;
 
        g_debug("export_xlat_prest ()");
        autoscale = ghb_value_boolean(preset_dict_get_value(dict, "autoscale"));
@@ -2502,10 +2510,6 @@ export_xlat_preset(GValue *dict)
                                preset_dict_get_value(dict, "vquality_type_bitrate"));
        constant = ghb_value_boolean(
                                preset_dict_get_value(dict, "vquality_type_constant"));
-       par_width = ghb_value_int(
-                               preset_dict_get_value(dict, "par_width"));
-       par_height = ghb_value_int(
-                               preset_dict_get_value(dict, "par_height"));
 
        if (autoscale)
                ghb_dict_insert(dict, g_strdup("UsesPictureSettings"), 
@@ -2530,17 +2534,31 @@ export_xlat_preset(GValue *dict)
                ghb_dict_insert(dict, g_strdup("VideoQualityType"), 
                                                ghb_int_value_new(2));
        }
-       ghb_dict_insert(dict, g_strdup("PicturePARWidth"), 
-                                               ghb_int_value_new(par_width));
-       ghb_dict_insert(dict, g_strdup("PicturePARHeight"), 
-                                               ghb_int_value_new(par_height));
+
+       GValue *alist, *adict;
+       gint count, ii;
+
+       alist = ghb_dict_lookup(dict, "AudioList");
+       count = ghb_array_len(alist);
+       for (ii = 0; ii < count; ii++)
+       {
+               gdouble drc;
+
+               adict = ghb_array_get_nth(alist, ii);
+               drc = ghb_value_double(
+                               preset_dict_get_value(adict, "AudioTrackDRCSlider"));
+               if (drc < 1.0 && drc > 0.0)
+               {
+                       ghb_dict_insert(adict, g_strdup("AudioTrackDRCSlider"), 
+                                                       ghb_double_value_new(0.0));
+               }
+       }
+
        ghb_dict_remove(dict, "UsesMaxPictureSettings");
        ghb_dict_remove(dict, "autoscale");
        ghb_dict_remove(dict, "vquality_type_target");
        ghb_dict_remove(dict, "vquality_type_bitrate");
        ghb_dict_remove(dict, "vquality_type_constant");
-       ghb_dict_remove(dict, "par_width");
-       ghb_dict_remove(dict, "par_height");
        export_value_xlat(dict);
 }
 
@@ -3048,7 +3066,7 @@ update_subtitle_presets(signal_user_data_t *ud)
        g_debug("update_subtitle_presets");
        const GValue *subtitle_list, *subtitle;
        GValue *slist, *dict;
-       gint count, ii;
+       gint count, ii, source;
 
        subtitle_list = ghb_settings_get_value(ud->settings, "subtitle_list");
        slist = ghb_array_value_new(8);
@@ -3056,10 +3074,14 @@ update_subtitle_presets(signal_user_data_t *ud)
        for (ii = 0; ii < count; ii++)
        {
                subtitle = ghb_array_get_nth(subtitle_list, ii);
-               dict = ghb_value_dup(subtitle);
-               ghb_array_append(slist, dict);
+               source = ghb_settings_get_int(subtitle, "SubtitleSource");
+               if (source != SRTSUB)
+               {
+                       dict = ghb_value_dup(subtitle);
+                       ghb_array_append(slist, dict);
+               }
        }
-       ghb_settings_set_value(ud->settings, "SubtitleList", slist);
+       ghb_settings_take_value(ud->settings, "SubtitleList", slist);
 }
 
 void