summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-11-24 04:08:41 +0000
committerjstebbins <[email protected]>2009-11-24 04:08:41 +0000
commit980a31be4e0dae47cb0f7fa600b4ef51dd4fbcf1 (patch)
tree3703705ad5fafe7bb10bdecce5d953f563c9bae4 /gtk/src/hb-backend.c
parent156acb8d52d8e517a1b4745396ddcea687472ccb (diff)
LinGui: make smarter bitrate choice when automatically selecting audio settings
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2967 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index bb41aa4cc..142264165 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -926,6 +926,33 @@ lookup_audio_rate_option(const GValue *rate)
return result;
}
+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 = 160;
+
+ result = high;
+ 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;
+ break;
+ }
+ }
+ return result;
+}
+
static gint
lookup_audio_bitrate_int(const GValue *rate)
{
@@ -3053,6 +3080,7 @@ ghb_get_audio_info(ghb_audio_info_t *ainfo, gint titleindex, gint audioindex)
if (audio == NULL) return FALSE; // Bad audioindex
ainfo->codec = audio->in.codec;
ainfo->bitrate = audio->in.bitrate;
+ ainfo->bitrate = 436000;
ainfo->samplerate = audio->in.samplerate;
return TRUE;
}