From 3205e96f56e88154494624a4b217b0c5b0a2f7b1 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Fri, 28 Jun 2013 16:54:16 +0000 Subject: LinGui: use hb_container_get_default_extension() when creating dest filename and fix a mostly harmless error in creating the dest filename that is only seen before scanning any files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5615 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/callbacks.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'gtk/src/callbacks.c') diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index eead66275..fed28a22a 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -563,21 +563,17 @@ static const gchar* get_extension(GValue *settings) { int container; - const gchar *extension = "error"; + const gchar *extension; container = ghb_settings_combo_int(settings, "FileFormat"); - if (container == HB_MUX_MP4) - { - extension = "mp4"; - if (ghb_settings_get_boolean(settings, "UseM4v")) - { - extension = "m4v"; - } - } - else if (container == HB_MUX_MKV) + if ((container & HB_MUX_MASK_MP4) && + ghb_settings_get_boolean(settings, "UseM4v")) { - extension = "mkv"; + return "m4v"; } + extension = hb_container_get_default_extension(container); + if (extension == NULL) + extension = "error"; return extension; } @@ -1082,7 +1078,7 @@ dvd_source_activate_cb(GtkAction *action, signal_user_data_t *ud) void ghb_update_destination_extension(signal_user_data_t *ud) { - static gchar *containers[] = {".mkv", ".mp4", ".m4v", NULL}; + static gchar *containers[] = {".mkv", ".mp4", ".m4v", ".error", NULL}; gchar *filename; const gchar *extension; gint ii; -- cgit v1.2.3