diff options
author | jstebbins <[email protected]> | 2015-02-15 00:04:23 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-02-15 00:04:23 +0000 |
commit | c721fa4582108285a8399348ad098fc4e0a766ae (patch) | |
tree | b617213c0ace1e7d401b77ffc8b161d1614902d3 | |
parent | 44581b93d45ea045c82344a361900d61fc170e18 (diff) |
LinGui: add Burn-In options to subtitle defaults
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6903 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/ghb-3.12.ui | 121 | ||||
-rw-r--r-- | gtk/src/ghb-3.14.ui | 124 | ||||
-rw-r--r-- | gtk/src/ghb.ui | 121 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 15 | ||||
-rw-r--r-- | gtk/src/internal_defaults.xml | 6 | ||||
-rw-r--r-- | gtk/src/subtitlehandler.c | 77 |
6 files changed, 450 insertions, 14 deletions
diff --git a/gtk/src/ghb-3.12.ui b/gtk/src/ghb-3.12.ui index bd2b1e5ae..13bf790f3 100644 --- a/gtk/src/ghb-3.12.ui +++ b/gtk/src/ghb-3.12.ui @@ -4668,6 +4668,10 @@ This permits DTS-HD passthru to be selected when automatic passthru selection is <object class="GtkListBox" id="subtitle_selected_lang"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Create a list of languages you would like to select subtitles for. + +The first language in this list is your "preferred" language and will be used +for determining subtitle selection settings when there is foreign audio.</property> </object> </child> </object> @@ -4812,12 +4816,127 @@ This search pass finds short sequences of foreign audio and provides subtitles f <property name="can_focus">True</property> <property name="receives_default">False</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">Closed captions are text subtitles that can be added to any container as a soft subtitle track (not burned)</property> + <property name="tooltip_text" translatable="yes">Closed captions are text subtitles that can be added to any container as a soft subtitle track</property> <property name="halign">start</property> <property name="draw_indicator">True</property> <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> </object> </child> + <child> + <object class="GtkBox" id="subtitle_burn_box"> + <property name="orientation">horizontal</property> + <property name="visible">True</property> + <property name="can_focus">False</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">4</property> + <child> + <object class="GtkLabel" id="sub_burn_behavior_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Burn-In Behavior:</property> + <property name="justify">right</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="SubtitleBurnBehavior"> + <property name="visible">True</property> + <property name="valign">GTK_ALIGN_CENTER</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Set the behavior of subtitle "Burn-In". + +Burned-In subtitles are part of the video and can not be disabled during playback. +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <signal name="changed" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkBox" id="subtitle_additional_burn_box"> + <property name="orientation">horizontal</property> + <property name="visible">True</property> + <property name="can_focus">False</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">4</property> + <child> + <object class="GtkLabel" id="sub_additional_burn_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Burn-In for deficient players:</property> + <property name="justify">right</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="SubtitleBurnDVDSub"> + <property name="label" translatable="yes">DVD Subtitles</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</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">Burn the first selected DVD subtitle track. All other DVD subtitle tracks will be discarded. +Use this option if your player software or device does not support DVD subtitles. + +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="SubtitleBurnBDSub"> + <property name="label" translatable="yes">Blu-ray Subtitles</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</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">Burn the first selected Blu-ray subtitle track. All other Blu-ray subtitle tracks will be discarded. +Use this option if your player software or device does not support Blu-ray subtitles. + +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">5</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sub_burn_warning_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes"><small>* Only one of the above subtitle burn options will be applied, starting with the top.</small></property> + <property name="tooltip_text" translatable="yes">Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="use_markup">True</property> + <property name="justify">left</property> + </object> + <packing> + <property name="position">6</property> + </packing> + </child> </object> <packing> <property name="position">5</property> diff --git a/gtk/src/ghb-3.14.ui b/gtk/src/ghb-3.14.ui index 408230d54..084c22124 100644 --- a/gtk/src/ghb-3.14.ui +++ b/gtk/src/ghb-3.14.ui @@ -4669,6 +4669,10 @@ This permits DTS-HD passthru to be selected when automatic passthru selection is <object class="GtkListBox" id="subtitle_selected_lang"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Create a list of languages you would like to select subtitles for. + +The first language in this list is your "preferred" language and will be used +for determining subtitle selection settings when there is foreign audio.</property> </object> </child> </object> @@ -4813,11 +4817,129 @@ This search pass finds short sequences of foreign audio and provides subtitles f <property name="can_focus">True</property> <property name="receives_default">False</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">Closed captions are text subtitles that can be added to any container as a soft subtitle track (not burned)</property> + <property name="tooltip_text" translatable="yes">Closed captions are text subtitles that can be added to any container as a soft subtitle track</property> <property name="halign">start</property> <property name="draw_indicator">True</property> <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkBox" id="subtitle_burn_box"> + <property name="orientation">horizontal</property> + <property name="visible">True</property> + <property name="can_focus">False</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">4</property> + <child> + <object class="GtkLabel" id="sub_burn_behavior_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Burn-In Behavior*:</property> + <property name="justify">right</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="SubtitleBurnBehavior"> + <property name="visible">True</property> + <property name="valign">GTK_ALIGN_CENTER</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Set the behavior of subtitle "Burn-In". + +Burned-In subtitles are part of the video and can not be disabled during playback. +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <signal name="changed" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkBox" id="subtitle_additional_burn_box"> + <property name="orientation">horizontal</property> + <property name="visible">True</property> + <property name="can_focus">False</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">4</property> + <child> + <object class="GtkLabel" id="sub_additional_burn_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Burn-In for deficient players*:</property> + <property name="justify">right</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="SubtitleBurnDVDSub"> + <property name="label" translatable="yes">DVD Subtitles</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</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">Burn the first selected DVD subtitle track. All other DVD subtitle tracks will be discarded. +Use this option if your player software or device does not support DVD subtitles. + +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="SubtitleBurnBDSub"> + <property name="label" translatable="yes">Blu-ray Subtitles</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</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">Burn the first selected Blu-ray subtitle track. All other Blu-ray subtitle tracks will be discarded. +Use this option if your player software or device does not support Blu-ray subtitles. + +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">5</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sub_burn_warning_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes"><small>* Only one of the above subtitle burn options will be applied, starting with the top.</small></property> + <property name="tooltip_text" translatable="yes">Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="use_markup">True</property> + <property name="justify">left</property> + </object> + <packing> + <property name="position">6</property> + </packing> </child> </object> <packing> diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index c91ccfc31..1a2abcc18 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -4668,6 +4668,10 @@ This permits DTS-HD passthru to be selected when automatic passthru selection is <object class="GtkListBox" id="subtitle_selected_lang"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Create a list of languages you would like to select subtitles for. + +The first language in this list is your "preferred" language and will be used +for determining subtitle selection settings when there is foreign audio.</property> </object> </child> </object> @@ -4812,12 +4816,127 @@ This search pass finds short sequences of foreign audio and provides subtitles f <property name="can_focus">True</property> <property name="receives_default">False</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">Closed captions are text subtitles that can be added to any container as a soft subtitle track (not burned)</property> + <property name="tooltip_text" translatable="yes">Closed captions are text subtitles that can be added to any container as a soft subtitle track</property> <property name="halign">start</property> <property name="draw_indicator">True</property> <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> </object> </child> + <child> + <object class="GtkBox" id="subtitle_burn_box"> + <property name="orientation">horizontal</property> + <property name="visible">True</property> + <property name="can_focus">False</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">4</property> + <child> + <object class="GtkLabel" id="sub_burn_behavior_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Burn-In Behavior:</property> + <property name="justify">right</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="SubtitleBurnBehavior"> + <property name="visible">True</property> + <property name="valign">GTK_ALIGN_CENTER</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Set the behavior of subtitle "Burn-In". + +Burned-In subtitles are part of the video and can not be disabled during playback. +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <signal name="changed" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkBox" id="subtitle_additional_burn_box"> + <property name="orientation">horizontal</property> + <property name="visible">True</property> + <property name="can_focus">False</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">4</property> + <child> + <object class="GtkLabel" id="sub_additional_burn_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Burn-In for deficient players:</property> + <property name="justify">right</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="SubtitleBurnDVDSub"> + <property name="label" translatable="yes">DVD Subtitles</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</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">Burn the first selected DVD subtitle track. All other DVD subtitle tracks will be discarded. +Use this option if your player software or device does not support DVD subtitles. + +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="SubtitleBurnBDSub"> + <property name="label" translatable="yes">Blu-ray Subtitles</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</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">Burn the first selected Blu-ray subtitle track. All other Blu-ray subtitle tracks will be discarded. +Use this option if your player software or device does not support Blu-ray subtitles. + +Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="halign">start</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="subtitle_def_widget_changed_cb" swapped="no"/> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">5</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sub_burn_warning_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes"><small>* Only one of the above subtitle burn options will be applied, starting with the top.</small></property> + <property name="tooltip_text" translatable="yes">Only one subtitle track can be burned! Since conflicts can occur, the first chosen wins.</property> + <property name="use_markup">True</property> + <property name="justify">left</property> + </object> + <packing> + <property name="position">6</property> + </packing> + </child> </object> <packing> <property name="position">5</property> diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 5489ad0f7..2216df598 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -65,6 +65,19 @@ combo_opts_t subtitle_track_sel_opts = d_subtitle_track_sel_opts }; +static options_map_t d_subtitle_burn_opts[] = +{ + {N_("None"), "none", 0, "0"}, + {N_("Foreign Audio Subtitle Track"), "foreign", 1, "1"}, + {N_("First Selected Track"), "first", 2, "2"}, + {N_("Foreign Audio, then First Selected Track"), "foreign_first", 3, "3"}, +}; +combo_opts_t subtitle_burn_opts = +{ + sizeof(d_subtitle_burn_opts)/sizeof(options_map_t), + d_subtitle_burn_opts +}; + static options_map_t d_audio_track_sel_opts[] = { {N_("None"), "none", 0, "0"}, @@ -380,6 +393,7 @@ typedef struct combo_name_map_t combo_name_map[] = { {"SubtitleTrackSelectionBehavior", &subtitle_track_sel_opts}, + {"SubtitleBurnBehavior", &subtitle_burn_opts}, {"AudioTrackSelectionBehavior", &audio_track_sel_opts}, {"PtoPType", &point_to_point_opts}, {"WhenComplete", &when_complete_opts}, @@ -2569,6 +2583,7 @@ ghb_update_ui_combo_box( subtitle_track_opts_set(ud->builder, "SubtitleTrack", user_data); small_opts_set(ud->builder, "VideoQualityGranularity", &vqual_granularity_opts); small_opts_set(ud->builder, "SubtitleTrackSelectionBehavior", &subtitle_track_sel_opts); + small_opts_set(ud->builder, "SubtitleBurnBehavior", &subtitle_burn_opts); small_opts_set(ud->builder, "AudioTrackSelectionBehavior", &audio_track_sel_opts); small_opts_set(ud->builder, "PtoPType", &point_to_point_opts); small_opts_set(ud->builder, "WhenComplete", &when_complete_opts); diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml index 3a71a1c01..a43f45841 100644 --- a/gtk/src/internal_defaults.xml +++ b/gtk/src/internal_defaults.xml @@ -337,6 +337,12 @@ <false /> <key>SubtitleAddForeignAudioSubtitle</key> <false /> + <key>SubtitleBurnBehavior</key> + <string>none</string> + <key>SubtitleBurnDVDSub</key> + <false /> + <key>SubtitleBurnBDSub</key> + <false /> <key>VideoTurboTwoPass</key> <false /> <key>UsesPictureFilters</key> diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c index 960fdb0ff..d584474f8 100644 --- a/gtk/src/subtitlehandler.c +++ b/gtk/src/subtitlehandler.c @@ -164,13 +164,34 @@ ghb_subtitle_exclusive_burn_settings(GValue *settings, gint index) gint ii, count; subtitle_list = ghb_settings_get_value(settings, "subtitle_list"); + subsettings = ghb_array_get_nth(subtitle_list, index); + if (subsettings != NULL) + { + int track = ghb_settings_get_int(subsettings, "SubtitleTrack"); + if (track == -1) + { + // Allow 2 tracks to be marked burned when one is + // foreign audio search. Extra burned track will be + // sanitized away if foreign audio search actually finds + // something. + return; + } + } count = ghb_array_len(subtitle_list); for (ii = 0; ii < count; ii++) { if (ii != index) { subsettings = ghb_array_get_nth(subtitle_list, ii); - ghb_settings_set_boolean(subsettings, "SubtitleBurned", FALSE); + int track = ghb_settings_get_int(subsettings, "SubtitleTrack"); + if (track != -1) + { + // Allow 2 tracks to be marked burned when one is + // foreign audio search. Extra burned track will be + // sanitized away if foreign audio search actually finds + // something. + ghb_settings_set_boolean(subsettings, "SubtitleBurned", FALSE); + } } } } @@ -349,6 +370,7 @@ static GValue* subtitle_add_track( int mux, gboolean default_track, gboolean srt, + gboolean burn, gboolean *burned) { int source = 0; @@ -363,7 +385,9 @@ static GValue* subtitle_add_track( source = SRTSUB; } - if (*burned && !hb_subtitle_can_pass(source, mux)) + burn |= !hb_subtitle_can_pass(source, mux); + + if (*burned && burn) { // Can only burn one. Skip others that must be burned. return NULL; @@ -392,10 +416,17 @@ static GValue* subtitle_add_track( subtitle_set_track_description(settings, subsettings); - if (!hb_subtitle_can_pass(source, mux)) + if (burn) { ghb_settings_set_boolean(subsettings, "SubtitleBurned", TRUE); - *burned = TRUE; + if (track != -1) + { + // Allow 2 tracks to be marked burned when one is + // foreign audio search. Extra burned track will be + // sanitized away if foreign audio search actually finds + // something. + *burned = TRUE; + } } else { @@ -450,6 +481,7 @@ ghb_set_pref_subtitle_settings(signal_user_data_t *ud, const hb_title_t *title, gboolean *used; const gchar *audio_lang, *pref_lang = NULL; gboolean foreign_audio_search, foreign_audio_subs; + gboolean burn_foreign, burn_first, burn_dvd, burn_bd; gboolean one_burned = FALSE; const GValue *lang_list; @@ -506,6 +538,13 @@ ghb_set_pref_subtitle_settings(signal_user_data_t *ud, const hb_title_t *title, used = g_malloc0(sub_count * sizeof(gboolean)); + int burn_behavior; + burn_behavior = ghb_settings_combo_int(settings, "SubtitleBurnBehavior"); + burn_foreign = burn_behavior == 1 || burn_behavior == 3; + burn_first = burn_behavior == 2 || burn_behavior == 3; + burn_dvd = ghb_settings_get_boolean(settings, "SubtitleBurnDVDSub"); + burn_bd = ghb_settings_get_boolean(settings, "SubtitleBurnBDSub"); + if (foreign_audio_subs && (audio_lang == NULL || strncmp(audio_lang, pref_lang, 4))) { @@ -515,9 +554,16 @@ ghb_set_pref_subtitle_settings(signal_user_data_t *ud, const hb_title_t *title, track = ghb_find_subtitle_track(title, pref_lang, 0); if (track > 0) { + gboolean burn; + hb_subtitle_t *subtitle; + subtitle = hb_list_item(title->list_subtitle, track); + burn = (subtitle->source == VOBSUB && burn_dvd) || + (subtitle->source == PGSSUB && burn_bd) || + burn_foreign || burn_first; used[track] = TRUE; subtitle_add_track(ud, settings, title, track, mux->format, - TRUE, FALSE, &one_burned); + !burn, FALSE, burn, &one_burned); + burn_first &= !burn; } } @@ -525,8 +571,10 @@ ghb_set_pref_subtitle_settings(signal_user_data_t *ud, const hb_title_t *title, (audio_lang != NULL && !strncmp(audio_lang, pref_lang, 4))) { // Add search for foreign audio segments + gboolean burn = burn_foreign || burn_first; subtitle_add_track(ud, settings, title, -1, mux->format, - TRUE, FALSE, &one_burned); + !burn, FALSE, burn, &one_burned); + burn_first &= !burn; } if (behavior != 0) @@ -543,9 +591,16 @@ ghb_set_pref_subtitle_settings(signal_user_data_t *ud, const hb_title_t *title, { if (!used[track]) { + gboolean burn; + hb_subtitle_t *subtitle; + subtitle = hb_list_item(title->list_subtitle, track); + burn = (subtitle->source == VOBSUB && burn_dvd) || + (subtitle->source == PGSSUB && burn_bd) || + burn_first; used[track] = TRUE; subtitle_add_track(ud, settings, title, track, mux->format, - FALSE, FALSE, &one_burned); + FALSE, FALSE, burn, &one_burned); + burn_first &= !burn; } next_track = track + 1; if (behavior == 2) @@ -573,7 +628,7 @@ ghb_set_pref_subtitle_settings(signal_user_data_t *ud, const hb_title_t *title, { used[track] = TRUE; subtitle_add_track(ud, settings, title, track, mux->format, - FALSE, FALSE, &one_burned); + FALSE, FALSE, burn_first, &one_burned); } } g_free(used); @@ -1136,12 +1191,12 @@ subtitle_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) subsettings == NULL && track < count; track++) { subsettings = subtitle_add_track(ud, ud->settings, title, track, - mux->format, FALSE, FALSE, &one_burned); + mux->format, FALSE, FALSE, FALSE, &one_burned); } if (subsettings == NULL) { subsettings = subtitle_add_track(ud, ud->settings, title, 0, - mux->format, FALSE, TRUE, &one_burned); + mux->format, FALSE, TRUE, FALSE, &one_burned); } ghb_add_subtitle_to_ui(ud, subsettings); @@ -1198,7 +1253,7 @@ subtitle_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) for (track = 0; track < count; track++) { subtitle_add_track(ud, ud->settings, title, track, mux->format, - FALSE, FALSE, &one_burned); + FALSE, FALSE, FALSE, &one_burned); } subtitle_refresh_list_ui(ud); ghb_live_reset(ud); |