OSDN Git Service

LinGui: fix a problem where I used the wrong aac bitrate cap
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 5 Oct 2010 22:51:50 +0000 (22:51 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 5 Oct 2010 22:51:50 +0000 (22:51 +0000)
wasn't allowing higher bitrate for aac 6ch in some cases.

git-svn-id: svn://localhost/HandBrake/trunk@3574 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/audiohandler.c
gtk/src/hb-backend.c

index e4bc6b8..82273e2 100644 (file)
@@ -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);
index f245cda..ea99e0c 100644 (file)
@@ -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;