]> granicus.if.org Git - handbrake/commitdiff
LinGui: Fix default destination filename for BDs
authorJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 28 Jun 2018 17:34:19 +0000 (10:34 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 28 Jun 2018 17:38:16 +0000 (10:38 -0700)
It was including the MPLS number as part of the default destination
filename

(cherry picked from commit f947915145ce0c905f6a1ef64274a0860f642445)

gtk/src/callbacks.c
gtk/src/hb-backend.c
gtk/src/hb-backend.h

index d5cb56a5d0c997d525a2af6b6e69d60fd506273a..2cc75782ff29ef3c67183ba1b19f8696ec6f5fe2 100644 (file)
@@ -2647,7 +2647,6 @@ ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings)
     if (title != NULL)
     {
         GhbValue *job_dict;
-        char * source_name;
 
         job_dict = hb_preset_job_init(ghb_scan_handle(), title_id, settings);
         ghb_dict_set(settings, "Job", job_dict);
@@ -2661,9 +2660,10 @@ ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings)
         ghb_dict_set_int(settings, "source_width", title->geometry.width);
         ghb_dict_set_int(settings, "source_height", title->geometry.height);
         ghb_dict_set_string(settings, "source", title->path);
-        source_name = ghb_create_source_label(title);
-        ghb_dict_set_string(settings, "source_label", source_name);
-        ghb_dict_set_string(settings, "volume", source_name);
+        ghb_dict_set_string(settings, "source_label",
+                            ghb_create_source_label(title));
+        ghb_dict_set_string(settings, "volume",
+                            ghb_create_volume_label(title));
 
         int crop[4];
 
index 3d947c8c149625b4c63d42ba48126e90f013f64c..e5c76a5b13eb5f07eb7eea07232d872c3bea4a3b 100644 (file)
@@ -2081,6 +2081,26 @@ ghb_create_source_label(const hb_title_t * title)
     return source;
 }
 
+gchar*
+ghb_create_volume_label(const hb_title_t * title)
+{
+    char * volname;
+
+    if (title != NULL && title->name != NULL && title->name[0] != 0)
+    {
+        volname = strdup(title->name);
+        if (title->type == HB_DVD_TYPE)
+        {
+            ghb_sanitize_volname(volname);
+        }
+    }
+    else
+    {
+        volname = g_strdup(_("No Title Found"));
+    }
+    return volname;
+}
+
 gchar*
 ghb_create_title_label(const hb_title_t *title)
 {
index 481aafbb22f4a77dd6fede03e60f87bd7e8815fd..8b8c7ff5a6d22f909d5433d1ae82fd0dbe19cd84 100644 (file)
@@ -183,7 +183,6 @@ void ghb_audio_samplerate_opts_filter(GtkComboBox *combo, gint acodec);
 int ghb_lookup_lang(const GhbValue *glang);
 const iso639_lang_t* ghb_iso639_lookup_by_int(int idx);
 void ghb_update_display_aspect_label(signal_user_data_t *ud);
-gchar* ghb_create_title_label(const hb_title_t *title);
 
 // libhb lookup helpers
 const hb_title_t* ghb_lookup_title(int title_id, int *index);
@@ -231,6 +230,8 @@ hb_handle_t* ghb_scan_handle(void);
 hb_handle_t* ghb_queue_handle(void);
 hb_handle_t* ghb_live_handle(void);
 void ghb_sanitize_volname(gchar *name);
+gchar* ghb_create_title_label(const hb_title_t *title);
 gchar* ghb_create_source_label(const hb_title_t * title);
+gchar* ghb_create_volume_label(const hb_title_t * title);
 
 #endif // _HBBACKEND_H_