diff options
-rw-r--r-- | gtk/src/ghb.ui | 75 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 81 | ||||
-rw-r--r-- | gtk/src/internal_defaults.xml | 8 | ||||
-rw-r--r-- | gtk/src/subtitlehandler.c | 40 | ||||
-rw-r--r-- | gtk/src/widgetdeps.c | 2 |
5 files changed, 50 insertions, 156 deletions
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 3495cbb76..c8d32afe6 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -2304,79 +2304,6 @@ audio-volume-medium</property> </packing> </child> <child> - <object class="GtkHBox" id="hbox79"> - <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="spacing">15</property> - <child> - <object class="GtkCheckButton" id="SubtitleForeignSearch"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Search subtitle tracks for one that may contain subtitles for foreign language segments of the audio track.</property> - <property name="label" translatable="yes">Foreign Audio Search</property> - <property name="active">False</property> - <property name="draw_indicator">True</property> - <signal handler="subtitle_foreign_changed_cb" name="toggled"/> - </object> - <packing> - <property name="expand">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="SubtitleForeignForced"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Only used the forced subtitles found.</property> - <property name="label" translatable="yes">Forced</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="setting_widget_changed_cb"/> - </object> - <packing> - <property name="expand">False</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="SubtitleForeignBurned"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip-text" translatable="yes">Burn subtitle into the video track.</property> - <property name="label" translatable="yes">Burned</property> - <property name="active">False</property> - <property name="draw_indicator">True</property> - <signal handler="subtitle_foreign_changed_cb" name="toggled"/> - </object> - <packing> - <property name="expand">False</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="SubtitleForeignDefaultTrack"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip-text" translatable="yes">Mark as the default subtitle track. Most players will display this track automatically.</property> - <property name="label" translatable="yes">Default</property> - <property name="active">False</property> - <property name="draw_indicator">True</property> - <signal handler="subtitle_foreign_changed_cb" name="toggled"/> - </object> - <packing> - <property name="expand">False</property> - <property name="position">3</property> - </packing> - </child> - </object> - <packing> - <property name="position">1</property> - <property name="expand">False</property> - </packing> - </child> - <child> <object class="GtkScrolledWindow" id="scrolledwindow4"> <property name="visible">True</property> <property name="can_focus">True</property> @@ -2393,7 +2320,7 @@ audio-volume-medium</property> </child> </object> <packing> - <property name="position">2</property> + <property name="position">1</property> </packing> </child> </object> diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 0361cb720..9540d4afb 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -1707,14 +1707,26 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) if (subtitle_opts.map) g_free(subtitle_opts.map); if (count > 0) { - subtitle_opts.count = count; - subtitle_opts.map = g_malloc((count)*sizeof(options_map_t)); + subtitle_opts.count = count+1; + subtitle_opts.map = g_malloc((count+1)*sizeof(options_map_t)); } else { - subtitle_opts.count = LANG_TABLE_SIZE; - subtitle_opts.map = g_malloc((LANG_TABLE_SIZE)*sizeof(options_map_t)); + subtitle_opts.count = LANG_TABLE_SIZE+1; + subtitle_opts.map = g_malloc((LANG_TABLE_SIZE+1)*sizeof(options_map_t)); } + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, + 0, "Foreign Audio Search", + 1, TRUE, + 2, "-1", + 3, -1.0, + 4, "auto", + -1); + subtitle_opts.map[0].option = "Foreign Audio Search"; + subtitle_opts.map[0].shortOpt = "-1"; + subtitle_opts.map[0].ivalue = -1; + subtitle_opts.map[0].svalue = "auto"; if (count > 0) { if (options != NULL) @@ -1727,10 +1739,10 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) // Skip subtitles that must be burned if there is already // a burned subtitle in the list options[ii] = g_strdup_printf("%d - %s", ii+1, subtitle->lang); - subtitle_opts.map[ii].option = options[ii]; - subtitle_opts.map[ii].shortOpt = index_str[ii]; - subtitle_opts.map[ii].ivalue = ii; - subtitle_opts.map[ii].svalue = subtitle->iso639_2; + subtitle_opts.map[ii+1].option = options[ii]; + subtitle_opts.map[ii+1].shortOpt = index_str[ii]; + subtitle_opts.map[ii+1].ivalue = ii; + subtitle_opts.map[ii+1].svalue = subtitle->iso639_2; gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, options[ii], @@ -1747,10 +1759,10 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) index_str_init(LANG_TABLE_SIZE-1); for (ii = 0; ii < LANG_TABLE_SIZE; ii++) { - subtitle_opts.map[ii].option = ghb_language_table[ii].eng_name; - subtitle_opts.map[ii].shortOpt = index_str[ii]; - subtitle_opts.map[ii].ivalue = ii; - subtitle_opts.map[ii].svalue = ghb_language_table[ii].iso639_2; + subtitle_opts.map[ii+1].option = ghb_language_table[ii].eng_name; + subtitle_opts.map[ii+1].shortOpt = index_str[ii]; + subtitle_opts.map[ii+1].ivalue = ii; + subtitle_opts.map[ii+1].svalue = ghb_language_table[ii].iso639_2; gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, ghb_language_table[ii].eng_name, @@ -3971,41 +3983,44 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) gboolean force, burned, def, one_burned = FALSE; job->select_subtitle = NULL; - if (ghb_settings_get_boolean(js, "SubtitleForeignSearch")) + subtitle_list = ghb_settings_get_value(js, "subtitle_list"); + count = ghb_array_len(subtitle_list); + for (ii = 0; ii < count; ii++) { - force = ghb_settings_get_boolean(js, "SubtitleForeignForced"); - burned = ghb_settings_get_boolean(js, "SubtitleForeignBurned"); - def = ghb_settings_get_boolean(js, "SubtitleForeignDefaultTrack"); + GValue *ssettings; + + ssettings = ghb_array_get_nth(subtitle_list, ii); - if (burned || job->mux != HB_MUX_MP4) + subtitle = ghb_settings_get_int(ssettings, "SubtitleTrack"); + force = ghb_settings_get_boolean(ssettings, "SubtitleForced"); + burned = ghb_settings_get_boolean(ssettings, "SubtitleBurned"); + def = ghb_settings_get_boolean(ssettings, "SubtitleDefaultTrack"); + + if (subtitle == -1) { if (!burned && job->mux == HB_MUX_MKV) { job->select_subtitle_config.dest = PASSTHRUSUB; } - if (burned) + else if (!burned && job->mux == HB_MUX_MP4) + { + // Skip any non-burned vobsubs when output is mp4 + continue; + } + else if (burned) + { + // Only allow one subtitle to be burned into the video + if (one_burned) + continue; one_burned = TRUE; + } job->select_subtitle_config.force = force; job->select_subtitle_config.default_track = def; job->indepth_scan = 1; job->select_subtitle = malloc(sizeof(hb_subtitle_t*)); *job->select_subtitle = NULL; } - } - subtitle_list = ghb_settings_get_value(js, "subtitle_list"); - count = ghb_array_len(subtitle_list); - for (ii = 0; ii < count; ii++) - { - GValue *ssettings; - - ssettings = ghb_array_get_nth(subtitle_list, ii); - - subtitle = ghb_settings_get_int(ssettings, "SubtitleTrack"); - force = ghb_settings_get_boolean(ssettings, "SubtitleForced"); - burned = ghb_settings_get_boolean(ssettings, "SubtitleBurned"); - def = ghb_settings_get_boolean(ssettings, "SubtitleDefaultTrack"); - - if (subtitle >= 0) + else if (subtitle >= 0) { hb_subtitle_t * subt; hb_subtitle_config_t sub_config; diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml index ac8bfa088..64de850b8 100644 --- a/gtk/src/internal_defaults.xml +++ b/gtk/src/internal_defaults.xml @@ -266,14 +266,6 @@ <integer>1</integer> <key>SourceAudioLang</key> <string>und</string> - <key>SubtitleForeignSearch</key> - <false /> - <key>SubtitleForeignForced</key> - <true /> - <key>SubtitleForeignBurned</key> - <false /> - <key>SubtitleForeignDefaultTrack</key> - <false /> <key>SubtitleList</key> <array> <dict> diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c index 1a54fecf3..ea863b612 100644 --- a/gtk/src/subtitlehandler.c +++ b/gtk/src/subtitlehandler.c @@ -71,12 +71,6 @@ ghb_subtitle_exclusive_burn(signal_user_data_t *ud, gint index) g_debug("ghb_subtitle_exclusive_burn"); subtitle_list = ghb_settings_get_value(ud->settings, "subtitle_list"); count = ghb_array_len(subtitle_list); - if (index != -1) - { - burned = ghb_settings_get_boolean(ud->settings, "SubtitleForeignBurned"); - if (burned && !mustBurn(ud, -1)) - ghb_ui_update(ud, "SubtitleForeignBurned", ghb_boolean_value(FALSE)); - } for (ii = 0; ii < count; ii++) { settings = ghb_array_get_nth(subtitle_list, ii); @@ -109,12 +103,6 @@ ghb_subtitle_exclusive_default(signal_user_data_t *ud, gint index) g_debug("ghb_subtitle_exclusive_default"); subtitle_list = ghb_settings_get_value(ud->settings, "subtitle_list"); count = ghb_array_len(subtitle_list); - if (index != -1) - { - def = ghb_settings_get_boolean(ud->settings, "SubtitleForeignDefaultTrack"); - if (def) - ghb_ui_update(ud, "SubtitleForeignDefaultTrack", ghb_boolean_value(FALSE)); - } for (ii = 0; ii < count; ii++) { settings = ghb_array_get_nth(subtitle_list, ii); @@ -128,7 +116,6 @@ ghb_subtitle_exclusive_default(signal_user_data_t *ud, gint index) { ghb_settings_set_boolean(settings, "SubtitleDefaultTrack", FALSE); - def = FALSE; gtk_list_store_set(GTK_LIST_STORE(tm), &ti, 3, FALSE, -1); } } @@ -723,7 +710,7 @@ ghb_subtitle_prune(signal_user_data_t *ud) GValue *subtitle_list, *settings; gint count, ii, track; gboolean burned; - gint first_track, one_burned = 0; + gint first_track = 0, one_burned = 0; subtitle_list = ghb_settings_get_value(ud->settings, "subtitle_list"); if (subtitle_list == NULL) @@ -754,13 +741,6 @@ ghb_subtitle_prune(signal_user_data_t *ud) { ghb_subtitle_exclusive_burn(ud, first_track); } - int mux; - mux = ghb_settings_combo_int(ud->settings, "FileFormat"); - if (mux == HB_MUX_MP4) - { - ghb_ui_update(ud, "SubtitleForeignBurned", ghb_boolean_value(TRUE)); - ghb_ui_update(ud, "SubtitleForeignDefaultTrack", ghb_boolean_value(FALSE)); - } } void @@ -786,21 +766,3 @@ ghb_reset_subtitles(signal_user_data_t *ud, GValue *settings) } } -G_MODULE_EXPORT void -subtitle_foreign_changed_cb(GtkWidget *widget, signal_user_data_t *ud) -{ - ghb_widget_to_setting(ud->settings, widget); - ghb_check_dependency(ud, widget); - ghb_clear_presets_selection(ud); - ghb_live_reset(ud); - - if (ghb_settings_get_boolean(ud->settings, "SubtitleForeignBurned")) - { - ghb_subtitle_exclusive_burn(ud, -1); - } - if (ghb_settings_get_boolean(ud->settings, "SubtitleForeignDefaultTrack")) - { - ghb_subtitle_exclusive_default(ud, -1); - } -} - diff --git a/gtk/src/widgetdeps.c b/gtk/src/widgetdeps.c index 90e80756b..af8049f58 100644 --- a/gtk/src/widgetdeps.c +++ b/gtk/src/widgetdeps.c @@ -40,8 +40,6 @@ static dependency_t dep_map[] = {"FileFormat", "Mp4LargeFile", "mp4|m4v", FALSE, TRUE}, {"FileFormat", "Mp4HttpOptimize", "mp4|m4v", FALSE, TRUE}, {"FileFormat", "Mp4iPodCompatible", "mp4|m4v", FALSE, TRUE}, - {"FileFormat", "SubtitleForeignBurned", "mp4|m4v", TRUE, FALSE}, - {"FileFormat", "SubtitleForeignDefaultTrack", "mp4|m4v", TRUE, FALSE}, {"PictureDecomb", "PictureDeinterlace", "none", FALSE, FALSE}, {"PictureDecomb", "PictureDeinterlaceCustom", "none", FALSE, TRUE}, {"PictureDeinterlace", "PictureDeinterlaceCustom", "custom", FALSE, TRUE}, |