diff options
author | jstebbins <[email protected]> | 2009-06-08 23:01:48 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-08 23:01:48 +0000 |
commit | 110f5b27f7370c38e4266c9a208d7a8594121c73 (patch) | |
tree | 91cb1af58072f1ee8035f94743f08aa8c13b3c9f /gtk/src/hb-backend.c | |
parent | 8dc32d2cfd52a1f1b97a2360d04241c9e2d96b13 (diff) |
LinGui: revert the extra widgets for subtitle foreign audio search
put it back in the list with the normal subtitle tracks.
gets rid of extra preset keys that were really unnecessary
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2504 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r-- | gtk/src/hb-backend.c | 81 |
1 files changed, 48 insertions, 33 deletions
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; |