]> 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:34:19 +0000 (10:34 -0700)
It was including the MPLS number as part of the default destination
filename

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

index 940b9b975d4b33db0bffdfd1707f8666c5a0d4e5..97cf705b3d0a828b64292cb5f7e39a624643201e 100644 (file)
@@ -2646,7 +2646,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);
@@ -2660,9 +2659,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 3143eb8c44d27e298aa883379a29d52b21cb2673..9208db5a7cb9645527176a52176f13d49c939ae5 100644 (file)
@@ -2080,6 +2080,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 7ebec5c1a19ff2e9023315009f717f173659d24b..ed46f55b0bec28cb2cabb981aa57001f095d9fff 100644 (file)
@@ -184,7 +184,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);
@@ -232,6 +231,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_