]> granicus.if.org Git - handbrake/commitdiff
LinGui: Change dest filename behavior when auto-naming is disabled
authorjstebbins <jstebbins.hb@gmail.com>
Tue, 11 Aug 2015 16:22:09 +0000 (16:22 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Tue, 11 Aug 2015 16:22:09 +0000 (16:22 +0000)
If auto-naming is disabled, don't set the destination filename to the
default "new_video".  Instead, leave it set to it's current value.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7399 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/callbacks.c
gtk/src/internal_defaults.json

index 72bd33a6f16710de85dfec1fda25c6ec4765e8d5..6e7a41db16eacb55aa3ab3bce6a9b4aebcab825b 100644 (file)
@@ -566,12 +566,26 @@ check_name_template(signal_user_data_t *ud, const char *str)
 static void
 set_destination_settings(signal_user_data_t *ud, GhbValue *settings)
 {
-    const gchar *extension;
+    const gchar *extension, *dest_file;
     gchar *filename;
 
     extension = get_extension(ud, settings);
 
     g_debug("set_destination_settings");
+    dest_file = ghb_dict_get_string(ud->settings, "dest_file");
+    if (dest_file == NULL)
+    {
+        // Initialize destination filename if it has no value yet.
+        // If auto-naming is disabled, this will be the default filename.
+        GString *str = g_string_new("");
+        const gchar *vol_name;
+        vol_name = ghb_dict_get_string(settings, "volume_label");
+        g_string_append_printf(str, "%s", vol_name);
+        g_string_append_printf(str, ".%s", extension);
+        filename = g_string_free(str, FALSE);
+        ghb_dict_set_string(settings, "dest_file", filename);
+        g_free(filename);
+    }
     if (ghb_dict_get_bool(ud->prefs, "auto_name"))
     {
         GString *str = g_string_new("");
index 285d982b0c17b4efaeefd2f5561922ec9f896e3d..6bf22e1282842e0dce5bc19feef8656df464fcc5 100644 (file)
@@ -30,7 +30,6 @@
         "angle": 1,
         "autoscale": true,
         "dest_dir": "",
-        "dest_file": "new_video.mp4",
         "end_point": 100.0,
         "MetaName": "",
         "MetaArtist": "",