summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/audiohandler.c15
-rw-r--r--gtk/src/callbacks.c117
-rw-r--r--gtk/src/callbacks.h1
-rw-r--r--gtk/src/ghb.ui17
-rw-r--r--gtk/src/hb-backend.c1
-rw-r--r--gtk/src/internal_defaults.xml2
-rw-r--r--gtk/src/presets.c2
-rw-r--r--gtk/src/widgetdeps.c6
8 files changed, 87 insertions, 74 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index 1638e0a27..4a6c77fb6 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -345,20 +345,7 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_widget_to_setting(asettings, widget);
audio_list_refresh_selected(ud);
}
-
- const GValue *audio_list;
- audio_list = ghb_settings_get_value(ud->settings, "audio_list");
- if (ghb_ac3_in_audio_list (audio_list))
- {
- gchar *container;
-
- container = ghb_settings_get_string(ud->settings, "FileFormat");
- if (strcmp(container, "mp4") == 0)
- {
- ghb_ui_update(ud, "FileFormat", ghb_string_value("m4v"));
- }
- g_free(container);
- }
+ ghb_update_destination_extension(ud);
ghb_live_reset(ud);
}
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 8fd2b7a94..2d458e1b4 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -507,6 +507,38 @@ ghb_cache_volnames(signal_user_data_t *ud)
return NULL;
}
+static const gchar*
+get_extension(signal_user_data_t *ud)
+{
+ int container;
+ const gchar *extension = "error";
+ GValue *audio_list;
+
+ container = ghb_settings_combo_int(ud->settings, "FileFormat");
+ if (container == HB_MUX_MP4)
+ {
+ extension = "mp4";
+ audio_list = ghb_settings_get_value(ud->settings, "audio_list");
+ if (ghb_ac3_in_audio_list (audio_list))
+ {
+ extension = "m4v";
+ }
+ else if (ghb_settings_get_boolean(ud->settings, "ChapterMarkers"))
+ {
+ extension = "m4v";
+ }
+ else if (ghb_settings_get_boolean(ud->settings, "UseM4v"))
+ {
+ extension = "m4v";
+ }
+ }
+ else if (container == HB_MUX_MKV)
+ {
+ extension = "mkv";
+ }
+ return extension;
+}
+
static void
set_destination(signal_user_data_t *ud)
{
@@ -514,12 +546,13 @@ set_destination(signal_user_data_t *ud)
if (ghb_settings_get_boolean(ud->settings, "use_source_name"))
{
GString *str = g_string_new("");
- gchar *vol_name, *filename, *extension;
+ gchar *vol_name, *filename;
+ const gchar *extension;
gchar *new_name;
gint title;
filename = ghb_settings_get_string(ud->settings, "dest_file");
- extension = ghb_settings_get_string(ud->settings, "FileFormat");
+ extension = get_extension(ud);
vol_name = ghb_settings_get_string(ud->settings, "volume_label");
g_string_append_printf(str, "%s", vol_name);
title = ghb_settings_combo_int(ud->settings, "title");
@@ -554,7 +587,6 @@ set_destination(signal_user_data_t *ud)
new_name = g_string_free(str, FALSE);
ghb_ui_update(ud, "dest_file", ghb_string_value(new_name));
g_free(filename);
- g_free(extension);
g_free(vol_name);
g_free(new_name);
}
@@ -978,17 +1010,24 @@ dvd_source_activate_cb(GtkAction *action, signal_user_data_t *ud)
g_free(sourcename);
}
-static void
-update_destination_extension(signal_user_data_t *ud)
+void
+ghb_update_destination_extension(signal_user_data_t *ud)
{
- static gchar *containers[] = {".mkv", ".mp4", ".m4v", ".avi", ".ogm", NULL};
+ static gchar *containers[] = {".mkv", ".mp4", ".m4v", NULL};
gchar *filename;
- gchar *extension;
+ const gchar *extension;
gint ii;
GtkEntry *entry;
+ static gboolean busy = FALSE;
- g_debug("update_destination_extension ()");
- extension = ghb_settings_get_string(ud->settings, "FileFormat");
+ g_debug("ghb_update_destination_extension ()");
+ // Since this function modifies the thing that triggers it's
+ // invocation, check to see if busy to prevent accidental infinite
+ // recursion.
+ if (busy)
+ return;
+ busy = TRUE;
+ extension = get_extension(ud);
entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "dest_file"));
filename = g_strdup(gtk_entry_get_text(entry));
for (ii = 0; containers[ii] != NULL; ii++)
@@ -1016,8 +1055,8 @@ update_destination_extension(signal_user_data_t *ud)
break;
}
}
- g_free(extension);
g_free(filename);
+ busy = FALSE;
}
static void
@@ -1083,7 +1122,7 @@ dest_file_changed_cb(GtkEntry *entry, signal_user_data_t *ud)
gchar *dest_file, *dest_dir, *dest;
g_debug("dest_file_changed_cb ()");
- update_destination_extension(ud);
+ ghb_update_destination_extension(ud);
ghb_widget_to_setting(ud->settings, (GtkWidget*)entry);
// This signal goes off with ever keystroke, so I'm putting this
// update on the timer.
@@ -1178,41 +1217,13 @@ update_acodec_combo(signal_user_data_t *ud)
G_MODULE_EXPORT void
container_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
- const GValue *audio_list;
- gboolean markers;
-
g_debug("container_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- update_destination_extension(ud);
ghb_check_dependency(ud, widget);
update_acodec_combo(ud);
+ ghb_update_destination_extension(ud);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
-
- audio_list = ghb_settings_get_value(ud->settings, "audio_list");
- if (ghb_ac3_in_audio_list (audio_list))
- {
- gchar *container;
-
- container = ghb_settings_get_string(ud->settings, "FileFormat");
- if (strcmp(container, "mp4") == 0)
- {
- ghb_ui_update(ud, "FileFormat", ghb_string_value("m4v"));
- }
- g_free(container);
- }
- markers = ghb_settings_get_boolean(ud->settings, "ChapterMarkers");
- if (markers)
- {
- gchar *container;
-
- container = ghb_settings_get_string(ud->settings, "FileFormat");
- if (strcmp(container, "mp4") == 0)
- {
- ghb_ui_update(ud, "FileFormat", ghb_string_value("m4v"));
- }
- g_free(container);
- }
ghb_subtitle_prune(ud);
}
@@ -1397,24 +1408,11 @@ setting_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
G_MODULE_EXPORT void
chapter_markers_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
- gboolean markers;
-
ghb_widget_to_setting(ud->settings, widget);
ghb_check_dependency(ud, widget);
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
- markers = ghb_settings_get_boolean(ud->settings, "ChapterMarkers");
- if (markers)
- {
- gchar *container;
-
- container = ghb_settings_get_string(ud->settings, "FileFormat");
- if (strcmp(container, "mp4") == 0)
- {
- ghb_ui_update(ud, "FileFormat", ghb_string_value("m4v"));
- }
- g_free(container);
- }
+ ghb_update_destination_extension(ud);
}
G_MODULE_EXPORT void
@@ -2922,6 +2920,17 @@ pref_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
}
G_MODULE_EXPORT void
+use_m4v_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ g_debug("use_m4v_changed_cb");
+ ghb_widget_to_setting (ud->settings, widget);
+ ghb_check_dependency(ud, widget);
+ const gchar *name = gtk_widget_get_name(widget);
+ ghb_pref_save(ud->settings, name);
+ ghb_update_destination_extension(ud);
+}
+
+G_MODULE_EXPORT void
skip_taskbar_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("pref_changed_cb");
diff --git a/gtk/src/callbacks.h b/gtk/src/callbacks.h
index 22de6ef7c..ad0bf18a4 100644
--- a/gtk/src/callbacks.h
+++ b/gtk/src/callbacks.h
@@ -60,6 +60,7 @@ void wm_drive_changed(MSG *msg, signal_user_data_t *ud);
#endif
gpointer ghb_cache_volnames(signal_user_data_t *ud);
void ghb_volname_cache_init(void);
+void ghb_update_destination_extension(signal_user_data_t *ud);
#endif // _CALLBACKS_H_
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index b31d66847..520db9556 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -900,10 +900,11 @@
<child>
<object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
+ <property name="spacing">4</property>
<child>
<object class="GtkLabel" id="label45">
<property name="visible">True</property>
- <property name="label" translatable="yes">Container:</property>
+ <property name="label" translatable="yes">Format:</property>
</object>
<packing>
<property name="expand">False</property>
@@ -3533,6 +3534,20 @@ no-dct-decimate=0:cabac=1</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="UseM4v">
+ <property name="label" translatable="yes">Use iPod/iTunes friendly (.m4v) file extension for MP4</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="use_m4v_changed_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 83877da67..94c5d5e8c 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -137,7 +137,6 @@ static options_map_t d_container_opts[] =
{
{"MKV", "mkv", HB_MUX_MKV, "mkv"},
{"MP4", "mp4", HB_MUX_MP4, "mp4"},
- {"M4V", "m4v", HB_MUX_MP4, "m4v"},
};
combo_opts_t container_opts =
{
diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml
index 32a05c1b5..27017ef04 100644
--- a/gtk/src/internal_defaults.xml
+++ b/gtk/src/internal_defaults.xml
@@ -149,6 +149,8 @@
<true />
<key>show_preview</key>
<true />
+ <key>UseM4v</key>
+ <false />
<key>use_source_name</key>
<true />
<key>update_skip_version</key>
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index b419414e6..01183d1a6 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -1763,7 +1763,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"},
diff --git a/gtk/src/widgetdeps.c b/gtk/src/widgetdeps.c
index 481cbf0ec..598b86b4e 100644
--- a/gtk/src/widgetdeps.c
+++ b/gtk/src/widgetdeps.c
@@ -37,9 +37,9 @@ static dependency_t dep_map[] =
{"vquality_type_constant", "VideoTwoPass", "TRUE", TRUE, FALSE},
{"vquality_type_constant", "VideoTurboTwoPass", "TRUE", TRUE, FALSE},
{"VideoTwoPass", "VideoTurboTwoPass", "TRUE", FALSE, FALSE},
- {"FileFormat", "Mp4LargeFile", "mp4|m4v", FALSE, TRUE},
- {"FileFormat", "Mp4HttpOptimize", "mp4|m4v", FALSE, TRUE},
- {"FileFormat", "Mp4iPodCompatible", "mp4|m4v", FALSE, TRUE},
+ {"FileFormat", "Mp4LargeFile", "mp4", FALSE, TRUE},
+ {"FileFormat", "Mp4HttpOptimize", "mp4", FALSE, TRUE},
+ {"FileFormat", "Mp4iPodCompatible", "mp4", FALSE, TRUE},
{"PictureDecomb", "PictureDeinterlace", "none", FALSE, FALSE},
{"PictureDecomb", "PictureDeinterlaceCustom", "none", FALSE, TRUE},
{"PictureDeinterlace", "PictureDeinterlaceCustom", "custom", FALSE, TRUE},