summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-05-04 03:09:29 +0000
committerjstebbins <[email protected]>2009-05-04 03:09:29 +0000
commit5a1a257865a3156151ca16670f27c2d2f8a3ef56 (patch)
treed1d4a43f6e663a50b10afeda80406840564aa747 /gtk
parent6be1d2f6861284fede24d8ca1021905846008a5a (diff)
LinGui: integrate with eddyg's subtitle list changes
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2374 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/hb-backend.c36
-rw-r--r--gtk/src/queuehandler.c4
2 files changed, 17 insertions, 23 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 05a0aeaa4..3a327343e 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -1638,10 +1638,10 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
3, -1.0,
4, "auto",
-1);
- subtitle_opts.map[0].option = "Same as audio";
- subtitle_opts.map[0].shortOpt = "auto";
- subtitle_opts.map[0].ivalue = -1;
- subtitle_opts.map[0].svalue = "auto";
+ subtitle_opts.map[1].option = "Same as audio";
+ subtitle_opts.map[1].shortOpt = "auto";
+ subtitle_opts.map[1].ivalue = -1;
+ subtitle_opts.map[1].svalue = "auto";
if (count > 0)
{
for (ii = 0; ii < count; ii++)
@@ -3715,35 +3715,25 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
job->x264opts = NULL;
}
gint subtitle;
- gchar *slang = ghb_settings_get_string(js, "Subtitles");
- subtitle = -2; // default to none
- if (strcmp(slang, "auto") == 0)
+ subtitle = ghb_settings_get_int(js, "subtitle_index");
+ if (subtitle == -1)
{
- subtitle = -1;
+ job->indepth_scan = 1;
}
- else
+ else if (subtitle >= 0)
{
- gint scount;
hb_subtitle_t * subt;
- scount = hb_list_count(title->list_subtitle);
- for (ii = 0; ii < scount; ii++)
+ subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, subtitle);
+ if (subt != NULL)
{
- subt = (hb_subtitle_t *)hb_list_item(title->list_subtitle, ii);
- if (strcmp(slang, subt->iso639_2) == 0)
- {
- subtitle = ii;
- break;
- }
+ hb_list_add(job->list_subtitle, subt);
}
}
gboolean forced_subtitles = ghb_settings_get_boolean(js, "SubtitlesForced");
job->subtitle_force = forced_subtitles;
- if (subtitle >= 0)
- job->subtitle = subtitle;
- else
- job->subtitle = -1;
- if (subtitle == -1)
+
+ if (job->indepth_scan == 1)
{
// Subtitle scan. Look for subtitle matching audio language
char *x264opts_tmp;
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index 1ac36ca89..8ff54419a 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -646,6 +646,7 @@ queue_add(signal_user_data_t *ud)
GValue *settings;
gint titleindex;
gint titlenum;
+ gint sub;
g_debug("queue_add ()");
if (!validate_settings(ud))
@@ -662,6 +663,9 @@ queue_add(signal_user_data_t *ud)
ud->queue = ghb_array_value_new(32);
// Make a copy of current settings to be used for the new job
settings = ghb_value_dup(ud->settings);
+ sub = ghb_settings_combo_int(settings, "Subtitles");
+ ghb_settings_set_int(settings, "subtitle_index", sub);
+
ghb_settings_set_int(settings, "job_status", GHB_QUEUE_PENDING);
ghb_settings_set_int(settings, "job_unique_id", 0);
titleindex = ghb_settings_combo_int(settings, "title");