summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/audiohandler.c7
-rw-r--r--gtk/src/hb-backend.c13
2 files changed, 5 insertions, 15 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index e4bc6b86d..82273e2af 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -109,7 +109,7 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud)
ghb_ui_update(ud, "AudioBitrate", ghb_int64_value(bitrate));
if (select_acodec == HB_ACODEC_FAAC)
{
- gint br, last = 320, first = 0;
+ gint last = 320, first = 0;
if (mix == HB_AMIXDOWN_6CH)
{
@@ -426,12 +426,13 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
titleindex = ghb_settings_combo_int(ud->settings, "title");
track = ghb_settings_combo_int(ud->settings, "AudioTrack");
- br = ghb_find_closest_audio_bitrate(acodec_code, br);
+ mix_code = ghb_get_best_mix( titleindex, track, acodec_code, mix_code);
+ int channels = HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(mix_code);
+ br = ghb_get_best_audio_bitrate(acodec_code, br, channels);
ghb_ui_update(ud, "AudioBitrate", ghb_int64_value(br));
sr = ghb_find_closest_audio_rate(sr);
ghb_ui_update(ud, "AudioSamplerate", ghb_int64_value(sr));
- mix_code = ghb_get_best_mix( titleindex, track, acodec_code, mix_code);
ghb_ui_update(ud, "AudioMixdown", ghb_int64_value(mix_code));
}
ghb_adjust_audio_rate_combos(ud);
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index f245cda06..ea99e0c57 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -1614,22 +1614,11 @@ gint
ghb_find_closest_audio_bitrate(gint codec, gint rate)
{
gint ii;
- gint low = 32;
- gint high = 768;
gint result;
- if (codec == HB_ACODEC_FAAC)
- high = 320;
- else if (codec == HB_ACODEC_AC3)
- high = 640;
-
- result = high;
+ result = hb_audio_bitrates[hb_audio_bitrates_count-1].rate;
for (ii = 0; ii < hb_audio_bitrates_count; ii++)
{
- if (hb_audio_bitrates[ii].rate < low)
- continue;
- if (hb_audio_bitrates[ii].rate > high)
- break;
if (rate <= hb_audio_bitrates[ii].rate)
{
result = hb_audio_bitrates[ii].rate;