summaryrefslogtreecommitdiffstats
path: root/gtk/src/subtitlehandler.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-05-22 22:46:59 +0000
committerjstebbins <[email protected]>2009-05-22 22:46:59 +0000
commit8690c484f325fab8335f8a87a10406726994961d (patch)
tree56402128900795487bb5f8f81ccf1269befb0679 /gtk/src/subtitlehandler.c
parentf9244003bdb97772ac713c1676b24ee2cf4a125a (diff)
LinGui: fix a couple bugs in subtitle handling
- validation of subtitiles wasn't looking at the 'enabled' flag so it gave an incorrect warning message for subtitles that were not enabled - subtitles were being erroneously enabled when there was no subtitle list in the preset git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2440 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/subtitlehandler.c')
-rw-r--r--gtk/src/subtitlehandler.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c
index 6dcded511..255da4744 100644
--- a/gtk/src/subtitlehandler.c
+++ b/gtk/src/subtitlehandler.c
@@ -68,14 +68,13 @@ add_all_pref_subtitles(signal_user_data_t *ud)
for (ii = 0; ii < count; ii++)
{
subtitle = ghb_value_dup(ghb_array_get_nth(pref_subtitle, ii));
- ghb_settings_set_boolean(subtitle, "SubtitleEnabled", TRUE);
lang = ghb_settings_get_string(subtitle, "SubtitleLanguage");
// If there are multiple subtitles using the same language, then
// select sequential tracks for each. The hash keeps track
// of the tracks used for each language.
track = ghb_find_pref_subtitle_track(lang);
g_free(lang);
- if (track >= 0)
+ if (track >= -1)
{
// Add to subtitle list
ghb_settings_set_int(subtitle, "SubtitleTrack", track);
@@ -88,7 +87,6 @@ void
ghb_set_pref_subtitle(gint titleindex, signal_user_data_t *ud)
{
gint track;
- GtkWidget *button;
GHashTable *track_indices;
char *lang;
@@ -107,9 +105,8 @@ ghb_set_pref_subtitle(gint titleindex, signal_user_data_t *ud)
return;
}
ghb_add_all_subtitles(ud, titleindex);
- // Find "best" subtitle based on subtitle preferences
- button = GHB_WIDGET (ud->builder, "subtitle_add");
+ // Find "best" subtitle based on subtitle preferences
pref_subtitle = ghb_settings_get_value(ud->settings, "SubtitleList");
count = ghb_array_len(pref_subtitle);
@@ -122,9 +119,8 @@ ghb_set_pref_subtitle(gint titleindex, signal_user_data_t *ud)
// of the tracks used for each language.
track = ghb_find_subtitle_track(titleindex, lang, track_indices);
g_free(lang);
- if (track >= 0)
+ if (track >= -1)
{
- ghb_settings_set_boolean(subtitle, "SubtitleEnabled", TRUE);
ghb_set_subtitle(ud, track, subtitle);
}
}