summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-11-18 19:39:05 +0000
committerjstebbins <[email protected]>2009-11-18 19:39:05 +0000
commit99748f4b7308a892bfdab1f14ffa4d9e4e436e19 (patch)
tree467d888474d298f42c58ada3b032ce1da8bd53de /gtk
parentfc45fb323ef56083c6a8753b6332b84b5faaf0fe (diff)
LinGui: set minimum bitrate to 192kbps when codec is faac and mix is 6-ch
If you ask faac for less than 192kbps with 6ch audio, you will get 192 anyway. This throws off target size estimates if target size was used. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2941 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/audiohandler.c15
-rw-r--r--gtk/src/hb-backend.c16
-rw-r--r--gtk/src/hb-backend.h3
3 files changed, 23 insertions, 11 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index 39d54c109..fbe5e90c7 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -47,7 +47,7 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud)
if (ghb_audio_is_passthru (acodec))
{
- ghb_set_default_bitrate_opts (ud->builder, -1);
+ ghb_set_default_bitrate_opts (ud->builder, 0, -1);
if (ghb_get_audio_info (&ainfo, titleindex, audioindex))
{
gint br = ainfo.bitrate / 1000;
@@ -70,12 +70,13 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud)
}
else if (acodec == HB_ACODEC_FAAC)
{
- gint br, last;
+ gint br, last = 160, first = 0;
if (mix == HB_AMIXDOWN_6CH)
+ {
+ first = 192;
last = 448;
- else
- last = 160;
+ }
widget = GHB_WIDGET(ud->builder, "AudioBitrate");
gval = ghb_widget_value(widget);
@@ -83,11 +84,13 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud)
ghb_value_free(gval);
if (br > last)
ghb_ui_update(ud, "AudioBitrate", ghb_int64_value(last));
- ghb_set_default_bitrate_opts (ud->builder, last);
+ if (br < first)
+ ghb_ui_update(ud, "AudioBitrate", ghb_int64_value(first));
+ ghb_set_default_bitrate_opts (ud->builder, first, last);
}
else
{
- ghb_set_default_bitrate_opts (ud->builder, -1);
+ ghb_set_default_bitrate_opts (ud->builder, 0, -1);
}
}
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 5d43d469e..7ac71720b 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -2677,7 +2677,11 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate)
}
static void
-audio_bitrate_opts_clean(GtkBuilder *builder, const gchar *name, gint last_rate)
+audio_bitrate_opts_clean(
+ GtkBuilder *builder,
+ const gchar *name,
+ gint first_rate,
+ gint last_rate)
{
GtkTreeIter iter;
GtkListStore *store;
@@ -2685,6 +2689,7 @@ audio_bitrate_opts_clean(GtkBuilder *builder, const gchar *name, gint last_rate)
gboolean done = FALSE;
gint ii = 0;
guint last = (guint)last_rate;
+ guint first = (guint)first_rate;
g_debug("audio_bitrate_opts_clean ()\n");
store = get_combo_box_store(builder, name);
@@ -2698,7 +2703,7 @@ audio_bitrate_opts_clean(GtkBuilder *builder, const gchar *name, gint last_rate)
{
done = !gtk_list_store_remove(store, &iter);
}
- else if (ivalue > last)
+ else if (ivalue < first || ivalue > last)
{
ii++;
gtk_list_store_set(store, &iter, 1, FALSE, -1);
@@ -2748,9 +2753,12 @@ ghb_set_passthru_bitrate_opts(GtkBuilder *builder, gint bitrate)
}
void
-ghb_set_default_bitrate_opts(GtkBuilder *builder, gint last_rate)
+ghb_set_default_bitrate_opts(
+ GtkBuilder *builder,
+ gint first_rate,
+ gint last_rate)
{
- audio_bitrate_opts_clean(builder, "AudioBitrate", last_rate);
+ audio_bitrate_opts_clean(builder, "AudioBitrate", first_rate, last_rate);
}
static ghb_status_t hb_status;
diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h
index e2470da70..92b006f4f 100644
--- a/gtk/src/hb-backend.h
+++ b/gtk/src/hb-backend.h
@@ -133,7 +133,8 @@ gint ghb_get_default_acodec(void);
gboolean ghb_get_audio_info(
ghb_audio_info_t *ainfo, gint titleindex, gint audioindex);
void ghb_set_passthru_bitrate_opts(GtkBuilder *builder, gint bitrate);
-void ghb_set_default_bitrate_opts(GtkBuilder *builder, gint last_rate);
+void ghb_set_default_bitrate_opts(
+ GtkBuilder *builder, gint first_rate, gint last_rate);
void ghb_grey_combo_options(GtkBuilder *builder);
void ghb_update_ui_combo_box(
signal_user_data_t *ud, const gchar *name, gint user_data, gboolean all);